• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #[path = "support/macros.rs"]
2 #[macro_use]
3 mod macros;
4 mod support;
5 
6 use criterion::{criterion_group, criterion_main, Criterion};
7 use glam::Mat3A;
8 use std::ops::Mul;
9 use support::*;
10 
11 bench_unop!(
12     mat3a_transpose,
13     "mat3a transpose",
14     op => transpose,
15     from => random_mat3a
16 );
17 bench_unop!(
18     mat3a_determinant,
19     "mat3a determinant",
20     op => determinant,
21     from => random_mat3a
22 );
23 bench_unop!(mat3a_inverse, "mat3a inverse", op => inverse, from => random_mat3a);
24 bench_binop!(mat3a_mul_mat3a, "mat3a mul mat3a", op => mul, from => random_mat3a);
25 bench_from_ypr!(mat3a_from_ypr, "mat3a from ypr", ty => Mat3A);
26 
27 bench_binop!(
28     mat3a_mul_vec3,
29     "mat3a mul vec3",
30     op => mul,
31     from1 => random_mat3a,
32     from2 => random_vec3
33 );
34 
35 bench_binop!(
36     mat3a_mul_vec3a,
37     "mat3a mul vec3a",
38     op => mul,
39     from1 => random_mat3a,
40     from2 => random_vec3a
41 );
42 
43 bench_binop!(
44     mat3a_transform_point2,
45     "mat3a transform point2",
46     op => transform_point2,
47     from1 => random_srt_mat3a,
48     from2 => random_vec2
49 );
50 
51 bench_binop!(
52     mat3a_transform_vector2,
53     "mat3a transform vector2",
54     op => transform_vector2,
55     from1 => random_srt_mat3a,
56     from2 => random_vec2
57 );
58 
59 criterion_group!(
60     benches,
61     mat3a_transpose,
62     mat3a_determinant,
63     mat3a_inverse,
64     mat3a_mul_vec3,
65     mat3a_mul_vec3a,
66     mat3a_mul_mat3a,
67     mat3a_from_ypr,
68     mat3a_transform_vector2,
69     mat3a_transform_point2,
70 );
71 
72 criterion_main!(benches);
73