mirror of
https://github.com/arnaucube/ark-curves-cherry-picked.git
synced 2026-01-08 15:01:29 +01:00
Work
This commit is contained in:
@@ -186,7 +186,7 @@ macro_rules! ec_bench {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$crate::bencher::benchmark_group!(
|
$crate::benchmark_group!(
|
||||||
group_ops,
|
group_ops,
|
||||||
rand,
|
rand,
|
||||||
mul_assign,
|
mul_assign,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ macro_rules! f_bench {
|
|||||||
field_common!($f, $f_type);
|
field_common!($f, $f_type);
|
||||||
sqrt!($f, $f_type);
|
sqrt!($f, $f_type);
|
||||||
prime_field!($f, $f_type, $f_repr, $f_repr_type);
|
prime_field!($f, $f_type, $f_repr, $f_repr_type);
|
||||||
$crate::bencher::benchmark_group!(
|
$crate::benchmark_group!(
|
||||||
$modname,
|
$modname,
|
||||||
// common stuff
|
// common stuff
|
||||||
add_assign,
|
add_assign,
|
||||||
@@ -44,7 +44,7 @@ macro_rules! f_bench {
|
|||||||
use super::*;
|
use super::*;
|
||||||
field_common!($f, $f_type);
|
field_common!($f, $f_type);
|
||||||
sqrt!($f, $f_type);
|
sqrt!($f, $f_type);
|
||||||
$crate::bencher::benchmark_group!(
|
$crate::benchmark_group!(
|
||||||
$modname,
|
$modname,
|
||||||
// common stuff
|
// common stuff
|
||||||
add_assign,
|
add_assign,
|
||||||
@@ -71,7 +71,7 @@ macro_rules! f_bench {
|
|||||||
mod [<_ $modname>] {
|
mod [<_ $modname>] {
|
||||||
use super::*;
|
use super::*;
|
||||||
field_common!($f, $f_type);
|
field_common!($f, $f_type);
|
||||||
$crate::bencher::benchmark_group!(
|
$crate::benchmark_group!(
|
||||||
$modname,
|
$modname,
|
||||||
// common stuff
|
// common stuff
|
||||||
add_assign,
|
add_assign,
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ macro_rules! pairing_bench {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
$crate::bencher::benchmark_group!(
|
$crate::benchmark_group!(
|
||||||
pairing,
|
pairing,
|
||||||
miller_loop,
|
miller_loop,
|
||||||
final_exponentiation,
|
final_exponentiation,
|
||||||
|
|||||||
@@ -8,3 +8,29 @@ macro_rules! n_fold {
|
|||||||
$tmp.$func();
|
$tmp.$func();
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Defines a function called `$group_name` that returns the test description
|
||||||
|
/// values for the listed functions `$function`.
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! benchmark_group {
|
||||||
|
($group_name:ident, $($function:path),+) => {
|
||||||
|
pub fn $group_name() -> ::std::vec::Vec<$crate::TestDescAndFn> {
|
||||||
|
use $crate::{TestDescAndFn, TestFn, TestDesc};
|
||||||
|
use std::borrow::Cow;
|
||||||
|
let mut benches = ::std::vec::Vec::new();
|
||||||
|
$(
|
||||||
|
benches.push(TestDescAndFn {
|
||||||
|
desc: TestDesc {
|
||||||
|
name: Cow::from(module_path!().to_string() + "::" + stringify!($function)),
|
||||||
|
ignore: false,
|
||||||
|
},
|
||||||
|
testfn: TestFn::StaticBenchFn($function),
|
||||||
|
});
|
||||||
|
)+
|
||||||
|
benches
|
||||||
|
}
|
||||||
|
};
|
||||||
|
($group_name:ident, $($function:path,)+) => {
|
||||||
|
benchmark_group!($group_name, $($function),+);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user