Skip to content
This repository was archived by the owner on Nov 6, 2020. It is now read-only.

Commit 5ec44b1

Browse files
timxorarkpar
authored andcommitted
added benchmark bn_128_add for EIP #198 (#6263)
1 parent fe3cfa8 commit 5ec44b1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ethcore/benches/evm.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,19 @@ fn bn_128_pairing(b: &mut Bencher) {
4747
});
4848
}
4949

50+
#[bench]
51+
fn bn_128_add(b: &mut Bencher) {
52+
use bn::{AffineG1, G1, Group};
53+
54+
let mut rng = StdRng::new().unwrap();
55+
let p1: G1 = G1::random(&mut rng);
56+
let p2: G1 = G1::random(&mut rng);
57+
58+
b.iter(|| {
59+
let _ = AffineG1::from_jacobian(p1 + p2);
60+
});
61+
}
62+
5063
#[bench]
5164
fn bn_128_mul(b: &mut Bencher) {
5265
use bn::{AffineG1, G1, Fr, Group};

0 commit comments

Comments
 (0)