@@ -16,7 +16,7 @@ fn main() {
1616}
1717
1818#[ divan:: bench_group(
19- sample_count = 500 ,
19+ sample_count = 2500 ,
2020 sample_size = 5000 ,
2121 threads = false ,
2222 counters = [ ItemsCount :: new( DIMS ) ] ,
@@ -29,7 +29,7 @@ mod dot_product {
2929
3030 use super :: * ;
3131
32- #[ divan:: bench( types = [ f32 , f64 , i8 , i16 , i32 , i64 , u8 , u16 , u32 , u64 ] ) ]
32+ #[ divan:: bench( types = [ f32 , f64 ] ) ]
3333 fn ndarray < T > ( bencher : Bencher )
3434 where
3535 Standard : Distribution < T > ,
@@ -48,7 +48,18 @@ mod dot_product {
4848 } ) ;
4949 }
5050
51- #[ divan:: bench( types = [ f32 , f64 , i8 , i16 , i32 , i64 , u8 , u16 , u32 , u64 ] ) ]
51+ #[ divan:: bench( types = [ f32 , f64 ] ) ]
52+ fn simsimd < T > ( bencher : Bencher )
53+ where
54+ Standard : Distribution < T > ,
55+ T : simsimd:: SpatialSimilarity ,
56+ {
57+ let ( l1, l2) = utils:: get_sample_vectors :: < T > ( DIMS ) ;
58+
59+ bencher. bench_local ( || T :: dot ( black_box ( & l1) , black_box ( & l2) ) ) ;
60+ }
61+
62+ #[ divan:: bench( types = [ f32 , f64 ] ) ]
5263 fn cfavml < T > ( bencher : Bencher )
5364 where
5465 Standard : Distribution < T > ,
@@ -66,7 +77,7 @@ mod dot_product {
6677}
6778
6879#[ divan:: bench_group(
69- sample_count = 500 ,
80+ sample_count = 2500 ,
7081 sample_size = 5000 ,
7182 threads = false ,
7283 counters = [ ItemsCount :: new( DIMS ) ] ,
@@ -104,6 +115,17 @@ mod cosine {
104115 } ) ;
105116 }
106117
118+ #[ divan:: bench( types = [ f32 , f64 ] ) ]
119+ fn simsimd < T > ( bencher : Bencher )
120+ where
121+ Standard : Distribution < T > ,
122+ T : simsimd:: SpatialSimilarity ,
123+ {
124+ let ( l1, l2) = utils:: get_sample_vectors :: < T > ( DIMS ) ;
125+
126+ bencher. bench_local ( || T :: cosine ( black_box ( & l1) , black_box ( & l2) ) ) ;
127+ }
128+
107129 #[ divan:: bench( types = [ f32 , f64 ] ) ]
108130 fn cfavml < T > ( bencher : Bencher )
109131 where
@@ -122,7 +144,7 @@ mod cosine {
122144}
123145
124146#[ divan:: bench_group(
125- sample_count = 500 ,
147+ sample_count = 2500 ,
126148 sample_size = 5000 ,
127149 threads = false ,
128150 counters = [ ItemsCount :: new( DIMS ) ] ,
@@ -161,6 +183,17 @@ mod euclidean {
161183 } ) ;
162184 }
163185
186+ #[ divan:: bench( types = [ f32 , f64 ] ) ]
187+ fn simsimd < T > ( bencher : Bencher )
188+ where
189+ Standard : Distribution < T > ,
190+ T : simsimd:: SpatialSimilarity ,
191+ {
192+ let ( l1, l2) = utils:: get_sample_vectors :: < T > ( DIMS ) ;
193+
194+ bencher. bench_local ( || T :: sqeuclidean ( black_box ( & l1) , black_box ( & l2) ) ) ;
195+ }
196+
164197 #[ divan:: bench( types = [ f32 , f64 ] ) ]
165198 fn cfavml < T > ( bencher : Bencher )
166199 where
0 commit comments