Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark the solutions #21

Open
clearloop opened this issue Dec 4, 2020 · 0 comments
Open

Benchmark the solutions #21

clearloop opened this issue Dec 4, 2020 · 0 comments

Comments

@clearloop
Copy link
Collaborator

Desc

Here we've got 3 solutions in Megcalite, besides duplicating problem in #20, we need to separate the tests for each solution, migrate the tests which are exactly we need, we don't need to test the primitives in each solution, we test the final result, for example, the result of add, mul and paring.

Benchmark

Here we can see a benchmark chapter in the rust unstable book.

Right after we completed the tests of the three basic functions, we can really do benchmarks for our wrapping work.

#![feature(test)]

extern crate test;
use test::Bencher;

#[bench]
fn bench_xor_1000_ints(b: &mut Bencher) {
    b.iter(|| {
        (0..1000).fold(0, |old, new| old ^ new);
    });
}

The benchmark code above is what we exactly need for our library, well, feeling like pairing 1000 times?

@clearloop clearloop mentioned this issue Dec 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant