@@ -7,8 +7,8 @@ const N2: usize = 448;
7
7
const N3 : usize = 86 ;
8
8
const N4 : usize = 41 ;
9
9
10
- fn comb_for1 ( c : & mut Criterion ) {
11
- c. bench_function ( "comb for1" , move |b| {
10
+ fn tuple_comb_for1 ( c : & mut Criterion ) {
11
+ c. bench_function ( "tuple comb for1" , move |b| {
12
12
b. iter ( || {
13
13
for i in 0 ..N1 {
14
14
black_box ( i) ;
@@ -17,8 +17,8 @@ fn comb_for1(c: &mut Criterion) {
17
17
} ) ;
18
18
}
19
19
20
- fn comb_for2 ( c : & mut Criterion ) {
21
- c. bench_function ( "comb for2" , move |b| {
20
+ fn tuple_comb_for2 ( c : & mut Criterion ) {
21
+ c. bench_function ( "tuple comb for2" , move |b| {
22
22
b. iter ( || {
23
23
for i in 0 ..N2 {
24
24
for j in ( i + 1 ) ..N2 {
@@ -29,8 +29,8 @@ fn comb_for2(c: &mut Criterion) {
29
29
} ) ;
30
30
}
31
31
32
- fn comb_for3 ( c : & mut Criterion ) {
33
- c. bench_function ( "comb for3" , move |b| {
32
+ fn tuple_comb_for3 ( c : & mut Criterion ) {
33
+ c. bench_function ( "tuple comb for3" , move |b| {
34
34
b. iter ( || {
35
35
for i in 0 ..N3 {
36
36
for j in ( i + 1 ) ..N3 {
@@ -43,8 +43,8 @@ fn comb_for3(c: &mut Criterion) {
43
43
} ) ;
44
44
}
45
45
46
- fn comb_for4 ( c : & mut Criterion ) {
47
- c. bench_function ( "comb for4" , move |b| {
46
+ fn tuple_comb_for4 ( c : & mut Criterion ) {
47
+ c. bench_function ( "tuple comb for4" , move |b| {
48
48
b. iter ( || {
49
49
for i in 0 ..N4 {
50
50
for j in ( i + 1 ) ..N4 {
@@ -59,8 +59,8 @@ fn comb_for4(c: &mut Criterion) {
59
59
} ) ;
60
60
}
61
61
62
- fn comb_c1 ( c : & mut Criterion ) {
63
- c. bench_function ( "comb c1" , move |b| {
62
+ fn tuple_comb_c1 ( c : & mut Criterion ) {
63
+ c. bench_function ( "tuple comb c1" , move |b| {
64
64
b. iter ( || {
65
65
for ( i, ) in ( 0 ..N1 ) . tuple_combinations ( ) {
66
66
black_box ( i) ;
@@ -69,8 +69,8 @@ fn comb_c1(c: &mut Criterion) {
69
69
} ) ;
70
70
}
71
71
72
- fn comb_c2 ( c : & mut Criterion ) {
73
- c. bench_function ( "comb c2" , move |b| {
72
+ fn tuple_comb_c2 ( c : & mut Criterion ) {
73
+ c. bench_function ( "tuple comb c2" , move |b| {
74
74
b. iter ( || {
75
75
for ( i, j) in ( 0 ..N2 ) . tuple_combinations ( ) {
76
76
black_box ( i + j) ;
@@ -79,8 +79,8 @@ fn comb_c2(c: &mut Criterion) {
79
79
} ) ;
80
80
}
81
81
82
- fn comb_c3 ( c : & mut Criterion ) {
83
- c. bench_function ( "comb c3" , move |b| {
82
+ fn tuple_comb_c3 ( c : & mut Criterion ) {
83
+ c. bench_function ( "tuple comb c3" , move |b| {
84
84
b. iter ( || {
85
85
for ( i, j, k) in ( 0 ..N3 ) . tuple_combinations ( ) {
86
86
black_box ( i + j + k) ;
@@ -89,8 +89,8 @@ fn comb_c3(c: &mut Criterion) {
89
89
} ) ;
90
90
}
91
91
92
- fn comb_c4 ( c : & mut Criterion ) {
93
- c. bench_function ( "comb c4" , move |b| {
92
+ fn tuple_comb_c4 ( c : & mut Criterion ) {
93
+ c. bench_function ( "tuple comb c4" , move |b| {
94
94
b. iter ( || {
95
95
for ( i, j, k, l) in ( 0 ..N4 ) . tuple_combinations ( ) {
96
96
black_box ( i + j + k + l) ;
@@ -101,13 +101,13 @@ fn comb_c4(c: &mut Criterion) {
101
101
102
102
criterion_group ! (
103
103
benches,
104
- comb_for1 ,
105
- comb_for2 ,
106
- comb_for3 ,
107
- comb_for4 ,
108
- comb_c1 ,
109
- comb_c2 ,
110
- comb_c3 ,
111
- comb_c4 ,
104
+ tuple_comb_for1 ,
105
+ tuple_comb_for2 ,
106
+ tuple_comb_for3 ,
107
+ tuple_comb_for4 ,
108
+ tuple_comb_c1 ,
109
+ tuple_comb_c2 ,
110
+ tuple_comb_c3 ,
111
+ tuple_comb_c4 ,
112
112
) ;
113
113
criterion_main ! ( benches) ;
0 commit comments