From 73c49884c3073deedeef1c48851bb3590ba14bb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Crozet?= Date: Sat, 27 Dec 2014 11:15:13 +0100 Subject: [PATCH] Fix benches. --- benches/common/macros.rs | 10 +++--- benches/construction.rs | 10 +++--- benches/dmat.rs | 24 +++++++------- benches/mat.rs | 48 ++++++++++++++-------------- benches/quat.rs | 18 +++++------ benches/vec.rs | 68 ++++++++++++++++++++-------------------- 6 files changed, 89 insertions(+), 89 deletions(-) diff --git a/benches/common/macros.rs b/benches/common/macros.rs index f7e67a8b..57492c47 100644 --- a/benches/common/macros.rs +++ b/benches/common/macros.rs @@ -21,7 +21,7 @@ macro_rules! bench_binop( }) } } -) +); macro_rules! bench_binop_na( ($name: ident, $t1: ty, $t2: ty, $binop: ident) => { @@ -44,7 +44,7 @@ macro_rules! bench_binop_na( }) } } -) +); macro_rules! bench_unop( ($name: ident, $t: ty, $unop: ident) => { @@ -66,7 +66,7 @@ macro_rules! bench_unop( }) } } -) +); macro_rules! bench_unop_self( ($name: ident, $t: ty, $unop: ident) => { @@ -88,7 +88,7 @@ macro_rules! bench_unop_self( }) } } -) +); macro_rules! bench_construction( ($name: ident, $constructor: path $(, $args: ident: $types: ty)*) => { @@ -111,4 +111,4 @@ macro_rules! bench_construction( }) } } -) +); diff --git a/benches/construction.rs b/benches/construction.rs index 02571de7..9782d718 100644 --- a/benches/construction.rs +++ b/benches/construction.rs @@ -10,9 +10,9 @@ use na::{UnitQuat, Rot2, Rot3, Vec1, Vec3}; #[path="common/macros.rs"] mod macros; -bench_construction!(_bench_quat_from_axisangle, UnitQuat::new, axisangle: Vec3) -bench_construction!(_bench_rot2_from_axisangle, Rot2::new, axisangle: Vec1) -bench_construction!(_bench_rot3_from_axisangle, Rot3::new, axisangle: Vec3) +bench_construction!(_bench_quat_from_axisangle, UnitQuat::new, axisangle: Vec3); +bench_construction!(_bench_rot2_from_axisangle, Rot2::new, axisangle: Vec1); +bench_construction!(_bench_rot3_from_axisangle, Rot3::new, axisangle: Vec3); -bench_construction!(_bench_quat_from_euler_angles, UnitQuat::new_with_euler_angles, roll: f32, pitch: f32, yaw: f32) -bench_construction!(_bench_rot3_from_euler_angles, Rot3::new_with_euler_angles, roll: f32, pitch: f32, yaw: f32) +bench_construction!(_bench_quat_from_euler_angles, UnitQuat::new_with_euler_angles, roll: f32, pitch: f32, yaw: f32); +bench_construction!(_bench_rot3_from_euler_angles, Rot3::new_with_euler_angles, roll: f32, pitch: f32, yaw: f32); diff --git a/benches/dmat.rs b/benches/dmat.rs index de02522d..4a5ee500 100644 --- a/benches/dmat.rs +++ b/benches/dmat.rs @@ -20,31 +20,31 @@ macro_rules! bench_mul_dmat( }) } } -) +); #[bench] fn bench_mul_dmat2(bh: &mut Bencher) { - bench_mul_dmat!(bh, 2, 2) + bench_mul_dmat!(bh, 2, 2); } #[bench] fn bench_mul_dmat3(bh: &mut Bencher) { - bench_mul_dmat!(bh, 3, 3) + bench_mul_dmat!(bh, 3, 3); } #[bench] fn bench_mul_dmat4(bh: &mut Bencher) { - bench_mul_dmat!(bh, 4, 4) + bench_mul_dmat!(bh, 4, 4); } #[bench] fn bench_mul_dmat5(bh: &mut Bencher) { - bench_mul_dmat!(bh, 5, 5) + bench_mul_dmat!(bh, 5, 5); } #[bench] fn bench_mul_dmat6(bh: &mut Bencher) { - bench_mul_dmat!(bh, 6, 6) + bench_mul_dmat!(bh, 6, 6); } macro_rules! bench_mul_dmat_dvec( @@ -62,29 +62,29 @@ macro_rules! bench_mul_dmat_dvec( }) } } -) +); #[bench] fn bench_mul_dmat_dvec2(bh: &mut Bencher) { - bench_mul_dmat_dvec!(bh, 2, 2) + bench_mul_dmat_dvec!(bh, 2, 2); } #[bench] fn bench_mul_dmat_dvec3(bh: &mut Bencher) { - bench_mul_dmat_dvec!(bh, 3, 3) + bench_mul_dmat_dvec!(bh, 3, 3); } #[bench] fn bench_mul_dmat_dvec4(bh: &mut Bencher) { - bench_mul_dmat_dvec!(bh, 4, 4) + bench_mul_dmat_dvec!(bh, 4, 4); } #[bench] fn bench_mul_dmat_dvec5(bh: &mut Bencher) { - bench_mul_dmat_dvec!(bh, 5, 5) + bench_mul_dmat_dvec!(bh, 5, 5); } #[bench] fn bench_mul_dmat_dvec6(bh: &mut Bencher) { - bench_mul_dmat_dvec!(bh, 6, 6) + bench_mul_dmat_dvec!(bh, 6, 6); } diff --git a/benches/mat.rs b/benches/mat.rs index 1ef956a9..6777ca36 100644 --- a/benches/mat.rs +++ b/benches/mat.rs @@ -10,34 +10,34 @@ use na::{Vec2, Vec3, Vec4, Mat2, Mat3, Mat4}; #[path="common/macros.rs"] mod macros; -bench_binop!(_bench_mat2_mul_m, Mat2, Mat2, mul) -bench_binop!(_bench_mat3_mul_m, Mat3, Mat3, mul) -bench_binop!(_bench_mat4_mul_m, Mat4, Mat4, mul) +bench_binop!(_bench_mat2_mul_m, Mat2, Mat2, mul); +bench_binop!(_bench_mat3_mul_m, Mat3, Mat3, mul); +bench_binop!(_bench_mat4_mul_m, Mat4, Mat4, mul); -bench_binop!(_bench_mat2_add_m, Mat2, Mat2, add) -bench_binop!(_bench_mat3_add_m, Mat3, Mat3, add) -bench_binop!(_bench_mat4_add_m, Mat4, Mat4, add) +bench_binop!(_bench_mat2_add_m, Mat2, Mat2, add); +bench_binop!(_bench_mat3_add_m, Mat3, Mat3, add); +bench_binop!(_bench_mat4_add_m, Mat4, Mat4, add); -bench_binop!(_bench_mat2_sub_m, Mat2, Mat2, sub) -bench_binop!(_bench_mat3_sub_m, Mat3, Mat3, sub) -bench_binop!(_bench_mat4_sub_m, Mat4, Mat4, sub) +bench_binop!(_bench_mat2_sub_m, Mat2, Mat2, sub); +bench_binop!(_bench_mat3_sub_m, Mat3, Mat3, sub); +bench_binop!(_bench_mat4_sub_m, Mat4, Mat4, sub); -bench_binop!(_bench_mat2_mul_v, Mat2, Vec2, mul) -bench_binop!(_bench_mat3_mul_v, Mat3, Vec3, mul) -bench_binop!(_bench_mat4_mul_v, Mat4, Vec4, mul) +bench_binop!(_bench_mat2_mul_v, Mat2, Vec2, mul); +bench_binop!(_bench_mat3_mul_v, Mat3, Vec3, mul); +bench_binop!(_bench_mat4_mul_v, Mat4, Vec4, mul); -bench_binop!(_bench_mat2_mul_s, Mat2, f32, mul) -bench_binop!(_bench_mat3_mul_s, Mat3, f32, mul) -bench_binop!(_bench_mat4_mul_s, Mat4, f32, mul) +bench_binop!(_bench_mat2_mul_s, Mat2, f32, mul); +bench_binop!(_bench_mat3_mul_s, Mat3, f32, mul); +bench_binop!(_bench_mat4_mul_s, Mat4, f32, mul); -bench_binop!(_bench_mat2_div_s, Mat2, f32, div) -bench_binop!(_bench_mat3_div_s, Mat3, f32, div) -bench_binop!(_bench_mat4_div_s, Mat4, f32, div) +bench_binop!(_bench_mat2_div_s, Mat2, f32, div); +bench_binop!(_bench_mat3_div_s, Mat3, f32, div); +bench_binop!(_bench_mat4_div_s, Mat4, f32, div); -bench_unop!(_bench_mat2_inv, Mat2, inv) -bench_unop!(_bench_mat3_inv, Mat3, inv) -bench_unop!(_bench_mat4_inv, Mat4, inv) +bench_unop!(_bench_mat2_inv, Mat2, inv); +bench_unop!(_bench_mat3_inv, Mat3, inv); +bench_unop!(_bench_mat4_inv, Mat4, inv); -bench_unop!(_bench_mat2_transpose, Mat2, transpose) -bench_unop!(_bench_mat3_transpose, Mat3, transpose) -bench_unop!(_bench_mat4_transpose, Mat4, transpose) +bench_unop!(_bench_mat2_transpose, Mat2, transpose); +bench_unop!(_bench_mat3_transpose, Mat3, transpose); +bench_unop!(_bench_mat4_transpose, Mat4, transpose); diff --git a/benches/quat.rs b/benches/quat.rs index 63224be3..dae0cf5d 100644 --- a/benches/quat.rs +++ b/benches/quat.rs @@ -10,13 +10,13 @@ use na::{Quat, UnitQuat, Vec3}; #[path="common/macros.rs"] mod macros; -bench_binop!(_bench_quat_add_q, Quat, Quat, add) -bench_binop!(_bench_quat_sub_q, Quat, Quat, sub) -bench_binop!(_bench_quat_mul_q, Quat, Quat, mul) +bench_binop!(_bench_quat_add_q, Quat, Quat, add); +bench_binop!(_bench_quat_sub_q, Quat, Quat, sub); +bench_binop!(_bench_quat_mul_q, Quat, Quat, mul); // bench_binop!(_bench_quat_div_q, Quat, Quat, div) -bench_binop!(_bench_quat_mul_v, UnitQuat, Vec3, mul) -bench_binop!(_bench_quat_mul_s, Quat, f32, mul) -bench_binop!(_bench_quat_div_s, Quat, f32, div) -bench_unop!(_bench_quat_inv, Quat, inv) -bench_unop_self!(_bench_quat_conjugate, Quat, conjugate) -bench_unop!(_bench_quat_normalize, Quat, normalize) +bench_binop!(_bench_quat_mul_v, UnitQuat, Vec3, mul); +bench_binop!(_bench_quat_mul_s, Quat, f32, mul); +bench_binop!(_bench_quat_div_s, Quat, f32, div); +bench_unop!(_bench_quat_inv, Quat, inv); +bench_unop_self!(_bench_quat_conjugate, Quat, conjugate); +bench_unop!(_bench_quat_normalize, Quat, normalize); diff --git a/benches/vec.rs b/benches/vec.rs index d0a00fa5..710490ca 100644 --- a/benches/vec.rs +++ b/benches/vec.rs @@ -10,48 +10,48 @@ use na::{Vec2, Vec3, Vec4}; #[path="common/macros.rs"] mod macros; -bench_binop!(_bench_vec2_add_v, Vec2, Vec2, add) -bench_binop!(_bench_vec3_add_v, Vec3, Vec3, add) -bench_binop!(_bench_vec4_add_v, Vec4, Vec4, add) +bench_binop!(_bench_vec2_add_v, Vec2, Vec2, add); +bench_binop!(_bench_vec3_add_v, Vec3, Vec3, add); +bench_binop!(_bench_vec4_add_v, Vec4, Vec4, add); -bench_binop!(_bench_vec2_sub_v, Vec2, Vec2, sub) -bench_binop!(_bench_vec3_sub_v, Vec3, Vec3, sub) -bench_binop!(_bench_vec4_sub_v, Vec4, Vec4, sub) +bench_binop!(_bench_vec2_sub_v, Vec2, Vec2, sub); +bench_binop!(_bench_vec3_sub_v, Vec3, Vec3, sub); +bench_binop!(_bench_vec4_sub_v, Vec4, Vec4, sub); -bench_binop!(_bench_vec2_mul_v, Vec2, Vec2, mul) -bench_binop!(_bench_vec3_mul_v, Vec3, Vec3, mul) -bench_binop!(_bench_vec4_mul_v, Vec4, Vec4, mul) +bench_binop!(_bench_vec2_mul_v, Vec2, Vec2, mul); +bench_binop!(_bench_vec3_mul_v, Vec3, Vec3, mul); +bench_binop!(_bench_vec4_mul_v, Vec4, Vec4, mul); -bench_binop!(_bench_vec2_div_v, Vec2, Vec2, div) -bench_binop!(_bench_vec3_div_v, Vec3, Vec3, div) -bench_binop!(_bench_vec4_div_v, Vec4, Vec4, div) +bench_binop!(_bench_vec2_div_v, Vec2, Vec2, div); +bench_binop!(_bench_vec3_div_v, Vec3, Vec3, div); +bench_binop!(_bench_vec4_div_v, Vec4, Vec4, div); -bench_binop!(_bench_vec2_add_s, Vec2, f32, add) -bench_binop!(_bench_vec3_add_s, Vec3, f32, add) -bench_binop!(_bench_vec4_add_s, Vec4, f32, add) +bench_binop!(_bench_vec2_add_s, Vec2, f32, add); +bench_binop!(_bench_vec3_add_s, Vec3, f32, add); +bench_binop!(_bench_vec4_add_s, Vec4, f32, add); -bench_binop!(_bench_vec2_sub_s, Vec2, f32, sub) -bench_binop!(_bench_vec3_sub_s, Vec3, f32, sub) -bench_binop!(_bench_vec4_sub_s, Vec4, f32, sub) +bench_binop!(_bench_vec2_sub_s, Vec2, f32, sub); +bench_binop!(_bench_vec3_sub_s, Vec3, f32, sub); +bench_binop!(_bench_vec4_sub_s, Vec4, f32, sub); -bench_binop!(_bench_vec2_mul_s, Vec2, f32, mul) -bench_binop!(_bench_vec3_mul_s, Vec3, f32, mul) -bench_binop!(_bench_vec4_mul_s, Vec4, f32, mul) +bench_binop!(_bench_vec2_mul_s, Vec2, f32, mul); +bench_binop!(_bench_vec3_mul_s, Vec3, f32, mul); +bench_binop!(_bench_vec4_mul_s, Vec4, f32, mul); -bench_binop!(_bench_vec2_div_s, Vec2, f32, div) -bench_binop!(_bench_vec3_div_s, Vec3, f32, div) -bench_binop!(_bench_vec4_div_s, Vec4, f32, div) +bench_binop!(_bench_vec2_div_s, Vec2, f32, div); +bench_binop!(_bench_vec3_div_s, Vec3, f32, div); +bench_binop!(_bench_vec4_div_s, Vec4, f32, div); -bench_binop_na!(_bench_vec2_dot, Vec2, Vec2, dot) -bench_binop_na!(_bench_vec3_dot, Vec3, Vec3, dot) -bench_binop_na!(_bench_vec4_dot, Vec4, Vec4, dot) +bench_binop_na!(_bench_vec2_dot, Vec2, Vec2, dot); +bench_binop_na!(_bench_vec3_dot, Vec3, Vec3, dot); +bench_binop_na!(_bench_vec4_dot, Vec4, Vec4, dot); -bench_binop_na!(_bench_vec3_cross, Vec3, Vec3, cross) +bench_binop_na!(_bench_vec3_cross, Vec3, Vec3, cross); -bench_unop!(_bench_vec2_norm, Vec2, norm) -bench_unop!(_bench_vec3_norm, Vec3, norm) -bench_unop!(_bench_vec4_norm, Vec4, norm) +bench_unop!(_bench_vec2_norm, Vec2, norm); +bench_unop!(_bench_vec3_norm, Vec3, norm); +bench_unop!(_bench_vec4_norm, Vec4, norm); -bench_unop!(_bench_vec2_normalize, Vec2, normalize) -bench_unop!(_bench_vec3_normalize, Vec3, normalize) -bench_unop!(_bench_vec4_normalize, Vec4, normalize) +bench_unop!(_bench_vec2_normalize, Vec2, normalize); +bench_unop!(_bench_vec3_normalize, Vec3, normalize); +bench_unop!(_bench_vec4_normalize, Vec4, normalize);