Skip to content

Commit 7f9ee70

Browse files
committed
rscrypto: adjusting thresholds for the Intel SPR triggers; adding the
CPU print to the comp benches.
1 parent 9409d39 commit 7f9ee70

6 files changed

Lines changed: 472 additions & 482 deletions

File tree

crates/checksum/bench_baseline/linux_arm64.txt

Lines changed: 170 additions & 168 deletions
Large diffs are not rendered by default.

crates/checksum/bench_baseline/linux_x86-64.txt

Lines changed: 131 additions & 144 deletions
Large diffs are not rendered by default.
Lines changed: 137 additions & 162 deletions
Original file line numberDiff line numberDiff line change
@@ -1,204 +1,179 @@
1-
Running benches/comp.rs (target/release/deps/comp-24ae1ad5b25f40af)
1+
Running benches/comp.rs (target/release/deps/comp-67526cd4db14de38)
22
Gnuplot not found, using plotters backend
33
crc64/xz/compare/rscrypto/aarch64/pmull-small/xs
4-
time: [6.2976 ns 6.3893 ns 6.5079 ns]
5-
thrpt: [9.1589 GiB/s 9.3288 GiB/s 9.4646 GiB/s]
6-
Found 3 outliers among 100 measurements (3.00%)
4+
time: [7.7437 ns 7.8411 ns 7.9881 ns]
5+
thrpt: [7.4617 GiB/s 7.6016 GiB/s 7.6972 GiB/s]
6+
Found 4 outliers among 100 measurements (4.00%)
7+
1 (1.00%) low mild
78
3 (3.00%) high severe
89
crc64/xz/compare/crc64fast/auto/xs
9-
time: [16.844 ns 16.866 ns 16.891 ns]
10-
thrpt: [3.5288 GiB/s 3.5340 GiB/s 3.5386 GiB/s]
11-
Found 7 outliers among 100 measurements (7.00%)
12-
2 (2.00%) high mild
13-
5 (5.00%) high severe
10+
time: [17.752 ns 17.939 ns 18.197 ns]
11+
thrpt: [3.2755 GiB/s 3.3227 GiB/s 3.3577 GiB/s]
12+
Found 10 outliers among 100 measurements (10.00%)
13+
2 (2.00%) low mild
14+
4 (4.00%) high mild
15+
4 (4.00%) high severe
1416
crc64/xz/compare/crc-fast/auto/xs
15-
time: [17.541 ns 17.723 ns 17.883 ns]
16-
thrpt: [3.3330 GiB/s 3.3631 GiB/s 3.3981 GiB/s]
17-
Found 22 outliers among 100 measurements (22.00%)
18-
12 (12.00%) low severe
19-
7 (7.00%) low mild
20-
1 (1.00%) high mild
21-
2 (2.00%) high severe
22-
crc64/xz/compare/rscrypto/aarch64/pmull-eor3/s
23-
time: [8.5603 ns 8.5996 ns 8.6600 ns]
24-
thrpt: [27.531 GiB/s 27.724 GiB/s 27.852 GiB/s]
17+
time: [19.766 ns 19.910 ns 20.053 ns]
18+
thrpt: [2.9724 GiB/s 2.9937 GiB/s 3.0155 GiB/s]
2519
Found 2 outliers among 100 measurements (2.00%)
26-
2 (2.00%) high severe
20+
2 (2.00%) high mild
21+
crc64/xz/compare/rscrypto/aarch64/pmull-eor3/s
22+
time: [9.0965 ns 9.1473 ns 9.2309 ns]
23+
thrpt: [25.828 GiB/s 26.064 GiB/s 26.210 GiB/s]
24+
Found 7 outliers among 100 measurements (7.00%)
25+
1 (1.00%) low mild
26+
3 (3.00%) high mild
27+
3 (3.00%) high severe
2728
crc64/xz/compare/crc64fast/auto/s
28-
time: [10.417 ns 10.426 ns 10.435 ns]
29-
thrpt: [22.849 GiB/s 22.867 GiB/s 22.888 GiB/s]
30-
Found 18 outliers among 100 measurements (18.00%)
31-
4 (4.00%) low severe
32-
10 (10.00%) low mild
29+
time: [10.605 ns 10.737 ns 11.009 ns]
30+
thrpt: [21.657 GiB/s 22.206 GiB/s 22.481 GiB/s]
31+
Found 5 outliers among 100 measurements (5.00%)
32+
2 (2.00%) low mild
3333
2 (2.00%) high mild
34-
2 (2.00%) high severe
34+
1 (1.00%) high severe
3535
crc64/xz/compare/crc-fast/auto/s
36-
time: [13.214 ns 13.222 ns 13.231 ns]
37-
thrpt: [18.020 GiB/s 18.032 GiB/s 18.043 GiB/s]
36+
time: [17.298 ns 17.552 ns 17.814 ns]
37+
thrpt: [13.383 GiB/s 13.583 GiB/s 13.783 GiB/s]
3838
Found 2 outliers among 100 measurements (2.00%)
39-
2 (2.00%) low mild
40-
crc64/xz/compare/rscrypto/aarch64/pmull-eor3/m
41-
time: [65.732 ns 65.786 ns 65.835 ns]
42-
thrpt: [57.944 GiB/s 57.987 GiB/s 58.034 GiB/s]
43-
Found 16 outliers among 100 measurements (16.00%)
44-
9 (9.00%) low severe
45-
2 (2.00%) low mild
4639
1 (1.00%) high mild
47-
4 (4.00%) high severe
40+
1 (1.00%) high severe
41+
crc64/xz/compare/rscrypto/aarch64/pmull-eor3/m
42+
time: [67.825 ns 68.594 ns 70.050 ns]
43+
thrpt: [54.457 GiB/s 55.613 GiB/s 56.243 GiB/s]
44+
Found 3 outliers among 100 measurements (3.00%)
45+
2 (2.00%) high mild
46+
1 (1.00%) high severe
4847
crc64/xz/compare/crc64fast/auto/m
49-
time: [67.372 ns 67.413 ns 67.447 ns]
50-
thrpt: [56.558 GiB/s 56.587 GiB/s 56.621 GiB/s]
51-
Found 21 outliers among 100 measurements (21.00%)
52-
7 (7.00%) low severe
53-
1 (1.00%) low mild
54-
4 (4.00%) high mild
55-
9 (9.00%) high severe
48+
time: [68.737 ns 68.923 ns 69.211 ns]
49+
thrpt: [55.117 GiB/s 55.348 GiB/s 55.497 GiB/s]
50+
Found 9 outliers among 100 measurements (9.00%)
51+
3 (3.00%) low mild
52+
2 (2.00%) high mild
53+
4 (4.00%) high severe
5654
crc64/xz/compare/crc-fast/auto/m
57-
time: [69.514 ns 69.552 ns 69.582 ns]
58-
thrpt: [54.823 GiB/s 54.847 GiB/s 54.877 GiB/s]
59-
Found 23 outliers among 100 measurements (23.00%)
60-
11 (11.00%) low severe
61-
2 (2.00%) low mild
62-
5 (5.00%) high mild
63-
5 (5.00%) high severe
55+
time: [73.544 ns 73.902 ns 74.576 ns]
56+
thrpt: [51.152 GiB/s 51.619 GiB/s 51.869 GiB/s]
57+
Found 11 outliers among 100 measurements (11.00%)
58+
3 (3.00%) low mild
59+
6 (6.00%) high mild
60+
2 (2.00%) high severe
6461
crc64/xz/compare/rscrypto/aarch64/pmull-eor3-3way/l
65-
time: [983.81 ns 984.23 ns 984.63 ns]
66-
thrpt: [61.988 GiB/s 62.013 GiB/s 62.039 GiB/s]
67-
Found 14 outliers among 100 measurements (14.00%)
68-
8 (8.00%) low severe
62+
time: [1.0054 µs 1.0145 µs 1.0304 µs]
63+
thrpt: [59.234 GiB/s 60.164 GiB/s 60.710 GiB/s]
64+
Found 11 outliers among 100 measurements (11.00%)
65+
3 (3.00%) low mild
66+
5 (5.00%) high mild
67+
3 (3.00%) high severe
68+
crc64/xz/compare/crc64fast/auto/l
69+
time: [1.0888 µs 1.1040 µs 1.1248 µs]
70+
thrpt: [54.265 GiB/s 55.287 GiB/s 56.056 GiB/s]
71+
Found 10 outliers among 100 measurements (10.00%)
6972
2 (2.00%) low mild
7073
2 (2.00%) high mild
71-
2 (2.00%) high severe
72-
crc64/xz/compare/crc64fast/auto/l
73-
time: [1.0586 µs 1.0605 µs 1.0631 µs]
74-
thrpt: [57.414 GiB/s 57.551 GiB/s 57.654 GiB/s]
75-
Found 3 outliers among 100 measurements (3.00%)
76-
1 (1.00%) high mild
77-
2 (2.00%) high severe
74+
6 (6.00%) high severe
7875
crc64/xz/compare/crc-fast/auto/l
79-
time: [1.0407 µs 1.0435 µs 1.0462 µs]
80-
thrpt: [58.342 GiB/s 58.493 GiB/s 58.651 GiB/s]
81-
Found 1 outliers among 100 measurements (1.00%)
82-
1 (1.00%) high mild
76+
time: [1.0957 µs 1.0969 µs 1.0981 µs]
77+
thrpt: [55.581 GiB/s 55.642 GiB/s 55.703 GiB/s]
8378
crc64/xz/compare/rscrypto/aarch64/pmull-eor3-3way/xl
84-
time: [15.570 µs 15.573 µs 15.575 µs]
85-
thrpt: [62.702 GiB/s 62.711 GiB/s 62.720 GiB/s]
86-
Found 11 outliers among 100 measurements (11.00%)
87-
1 (1.00%) low severe
88-
4 (4.00%) high mild
89-
6 (6.00%) high severe
79+
time: [15.909 µs 15.924 µs 15.940 µs]
80+
thrpt: [61.265 GiB/s 61.325 GiB/s 61.385 GiB/s]
81+
Found 8 outliers among 100 measurements (8.00%)
82+
3 (3.00%) low mild
83+
3 (3.00%) high mild
84+
2 (2.00%) high severe
9085
crc64/xz/compare/crc64fast/auto/xl
91-
time: [17.354 µs 17.520 µs 17.871 µs]
92-
thrpt: [54.644 GiB/s 55.739 GiB/s 56.274 GiB/s]
93-
Found 11 outliers among 100 measurements (11.00%)
94-
4 (4.00%) low severe
95-
2 (2.00%) low mild
86+
time: [17.670 µs 17.894 µs 18.354 µs]
87+
thrpt: [53.208 GiB/s 54.576 GiB/s 55.266 GiB/s]
88+
Found 5 outliers among 100 measurements (5.00%)
89+
1 (1.00%) low mild
9690
2 (2.00%) high mild
97-
3 (3.00%) high severe
91+
2 (2.00%) high severe
9892
crc64/xz/compare/crc-fast/auto/xl
99-
time: [17.346 µs 17.363 µs 17.381 µs]
100-
thrpt: [56.187 GiB/s 56.244 GiB/s 56.300 GiB/s]
93+
time: [17.693 µs 17.709 µs 17.725 µs]
94+
thrpt: [55.094 GiB/s 55.144 GiB/s 55.195 GiB/s]
10195
Found 4 outliers among 100 measurements (4.00%)
10296
1 (1.00%) low mild
103-
2 (2.00%) high mild
104-
1 (1.00%) high severe
97+
3 (3.00%) high mild
10598

10699
crc64/nvme/compare/rscrypto/aarch64/pmull-small/xs
107-
time: [6.2906 ns 6.2982 ns 6.3061 ns]
108-
thrpt: [9.4519 GiB/s 9.4637 GiB/s 9.4752 GiB/s]
109-
Found 5 outliers among 100 measurements (5.00%)
110-
5 (5.00%) high mild
111-
crc64/nvme/compare/crc64fast-nvme/auto/xs
112-
time: [17.069 ns 17.238 ns 17.561 ns]
113-
thrpt: [3.3941 GiB/s 3.4578 GiB/s 3.4920 GiB/s]
114-
Found 5 outliers among 100 measurements (5.00%)
115-
4 (4.00%) high mild
100+
time: [7.4442 ns 7.4569 ns 7.4713 ns]
101+
thrpt: [7.9778 GiB/s 7.9932 GiB/s 8.0069 GiB/s]
102+
Found 2 outliers among 100 measurements (2.00%)
103+
1 (1.00%) low mild
116104
1 (1.00%) high severe
105+
crc64/nvme/compare/crc64fast-nvme/auto/xs
106+
time: [17.812 ns 17.836 ns 17.860 ns]
107+
thrpt: [3.3373 GiB/s 3.3418 GiB/s 3.3464 GiB/s]
108+
Found 2 outliers among 100 measurements (2.00%)
109+
2 (2.00%) low mild
117110
crc64/nvme/compare/crc-fast/auto/xs
118-
time: [16.423 ns 16.609 ns 16.823 ns]
119-
thrpt: [3.5430 GiB/s 3.5886 GiB/s 3.6293 GiB/s]
111+
time: [19.992 ns 20.148 ns 20.310 ns]
112+
thrpt: [2.9348 GiB/s 2.9583 GiB/s 2.9815 GiB/s]
120113
Found 1 outliers among 100 measurements (1.00%)
121114
1 (1.00%) low mild
122115
crc64/nvme/compare/rscrypto/aarch64/pmull-eor3/s
123-
time: [8.5440 ns 8.5541 ns 8.5641 ns]
124-
thrpt: [27.839 GiB/s 27.872 GiB/s 27.905 GiB/s]
125-
Found 3 outliers among 100 measurements (3.00%)
126-
2 (2.00%) high mild
127-
1 (1.00%) high severe
116+
time: [9.1422 ns 9.1519 ns 9.1611 ns]
117+
thrpt: [26.025 GiB/s 26.051 GiB/s 26.079 GiB/s]
118+
Found 7 outliers among 100 measurements (7.00%)
119+
2 (2.00%) low mild
120+
1 (1.00%) high mild
121+
4 (4.00%) high severe
128122
crc64/nvme/compare/crc64fast-nvme/auto/s
129-
time: [10.524 ns 10.548 ns 10.573 ns]
130-
thrpt: [22.550 GiB/s 22.604 GiB/s 22.656 GiB/s]
131-
Found 3 outliers among 100 measurements (3.00%)
132-
3 (3.00%) high mild
133-
crc64/nvme/compare/crc-fast/auto/s
134-
time: [13.180 ns 13.189 ns 13.198 ns]
135-
thrpt: [18.065 GiB/s 18.077 GiB/s 18.090 GiB/s]
136-
Found 6 outliers among 100 measurements (6.00%)
137-
1 (1.00%) low severe
123+
time: [10.627 ns 10.667 ns 10.718 ns]
124+
thrpt: [22.245 GiB/s 22.350 GiB/s 22.436 GiB/s]
125+
Found 16 outliers among 100 measurements (16.00%)
138126
1 (1.00%) low mild
139-
1 (1.00%) high mild
140-
3 (3.00%) high severe
127+
7 (7.00%) high mild
128+
8 (8.00%) high severe
129+
crc64/nvme/compare/crc-fast/auto/s
130+
time: [17.274 ns 17.502 ns 17.731 ns]
131+
thrpt: [13.446 GiB/s 13.623 GiB/s 13.802 GiB/s]
141132
crc64/nvme/compare/rscrypto/aarch64/pmull-eor3/m
142-
time: [65.781 ns 65.884 ns 66.003 ns]
143-
thrpt: [57.796 GiB/s 57.900 GiB/s 57.990 GiB/s]
144-
Found 8 outliers among 100 measurements (8.00%)
145-
1 (1.00%) low mild
146-
6 (6.00%) high mild
147-
1 (1.00%) high severe
133+
time: [67.225 ns 67.976 ns 69.436 ns]
134+
thrpt: [54.938 GiB/s 56.118 GiB/s 56.745 GiB/s]
135+
Found 4 outliers among 100 measurements (4.00%)
136+
2 (2.00%) high mild
137+
2 (2.00%) high severe
148138
crc64/nvme/compare/crc64fast-nvme/auto/m
149-
time: [67.383 ns 67.445 ns 67.511 ns]
150-
thrpt: [56.504 GiB/s 56.560 GiB/s 56.612 GiB/s]
151-
Found 8 outliers among 100 measurements (8.00%)
152-
5 (5.00%) low mild
153-
3 (3.00%) high severe
139+
time: [67.657 ns 67.712 ns 67.776 ns]
140+
thrpt: [56.284 GiB/s 56.337 GiB/s 56.383 GiB/s]
141+
Found 4 outliers among 100 measurements (4.00%)
142+
2 (2.00%) high mild
143+
2 (2.00%) high severe
154144
crc64/nvme/compare/crc-fast/auto/m
155-
time: [69.533 ns 69.581 ns 69.629 ns]
156-
thrpt: [54.786 GiB/s 54.824 GiB/s 54.862 GiB/s]
157-
Found 9 outliers among 100 measurements (9.00%)
158-
1 (1.00%) low severe
159-
2 (2.00%) low mild
160-
5 (5.00%) high mild
161-
1 (1.00%) high severe
145+
time: [72.632 ns 72.737 ns 72.842 ns]
146+
thrpt: [52.369 GiB/s 52.445 GiB/s 52.521 GiB/s]
147+
Found 4 outliers among 100 measurements (4.00%)
148+
4 (4.00%) high mild
162149
crc64/nvme/compare/rscrypto/aarch64/pmull-eor3-3way/l
163-
time: [983.84 ns 984.15 ns 984.40 ns]
164-
thrpt: [62.002 GiB/s 62.018 GiB/s 62.037 GiB/s]
165-
Found 16 outliers among 100 measurements (16.00%)
166-
3 (3.00%) low severe
167-
2 (2.00%) low mild
168-
6 (6.00%) high mild
169-
5 (5.00%) high severe
150+
time: [990.98 ns 995.89 ns 1.0052 µs]
151+
thrpt: [60.720 GiB/s 61.287 GiB/s 61.591 GiB/s]
152+
Found 2 outliers among 100 measurements (2.00%)
153+
2 (2.00%) high severe
170154
crc64/nvme/compare/crc64fast-nvme/auto/l
171-
time: [1.0624 µs 1.0630 µs 1.0634 µs]
172-
thrpt: [57.399 GiB/s 57.420 GiB/s 57.449 GiB/s]
173-
Found 16 outliers among 100 measurements (16.00%)
174-
4 (4.00%) low severe
175-
3 (3.00%) low mild
176-
4 (4.00%) high mild
177-
5 (5.00%) high severe
155+
time: [1.0705 µs 1.0716 µs 1.0727 µs]
156+
thrpt: [56.900 GiB/s 56.957 GiB/s 57.014 GiB/s]
157+
Found 5 outliers among 100 measurements (5.00%)
158+
2 (2.00%) high mild
159+
3 (3.00%) high severe
178160
crc64/nvme/compare/crc-fast/auto/l
179-
time: [1.0447 µs 1.0474 µs 1.0499 µs]
180-
thrpt: [58.135 GiB/s 58.272 GiB/s 58.424 GiB/s]
161+
time: [1.0873 µs 1.0887 µs 1.0902 µs]
162+
thrpt: [55.988 GiB/s 56.063 GiB/s 56.135 GiB/s]
181163
crc64/nvme/compare/rscrypto/aarch64/pmull-eor3-3way/xl
182-
time: [15.567 µs 15.569 µs 15.572 µs]
183-
thrpt: [62.713 GiB/s 62.723 GiB/s 62.731 GiB/s]
184-
Found 13 outliers among 100 measurements (13.00%)
185-
2 (2.00%) low severe
186-
1 (1.00%) low mild
187-
4 (4.00%) high mild
188-
6 (6.00%) high severe
164+
time: [15.635 µs 15.765 µs 16.026 µs]
165+
thrpt: [60.937 GiB/s 61.944 GiB/s 62.460 GiB/s]
166+
Found 5 outliers among 100 measurements (5.00%)
167+
3 (3.00%) high mild
168+
2 (2.00%) high severe
189169
crc64/nvme/compare/crc64fast-nvme/auto/xl
190-
time: [17.352 µs 17.360 µs 17.367 µs]
191-
thrpt: [56.230 GiB/s 56.254 GiB/s 56.279 GiB/s]
192-
Found 9 outliers among 100 measurements (9.00%)
193-
2 (2.00%) low severe
194-
2 (2.00%) low mild
195-
1 (1.00%) high mild
196-
4 (4.00%) high severe
170+
time: [17.413 µs 17.432 µs 17.452 µs]
171+
thrpt: [55.958 GiB/s 56.022 GiB/s 56.082 GiB/s]
172+
Found 3 outliers among 100 measurements (3.00%)
173+
2 (2.00%) high mild
174+
1 (1.00%) high severe
197175
crc64/nvme/compare/crc-fast/auto/xl
198-
time: [17.373 µs 17.525 µs 17.849 µs]
199-
thrpt: [54.712 GiB/s 55.724 GiB/s 56.211 GiB/s]
200-
Found 10 outliers among 100 measurements (10.00%)
201-
1 (1.00%) low severe
202-
3 (3.00%) low mild
176+
time: [17.449 µs 17.468 µs 17.488 µs]
177+
thrpt: [55.842 GiB/s 55.905 GiB/s 55.968 GiB/s]
178+
Found 1 outliers among 100 measurements (1.00%)
203179
1 (1.00%) high mild
204-
5 (5.00%) high severe

crates/checksum/benches/comp.rs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,33 @@
11
use core::hint::black_box;
2+
use std::sync::Once;
23

34
use checksum::{Checksum, Crc64, Crc64Nvme};
45
use crc_fast::{CrcAlgorithm as CrcFastAlgorithm, Digest as CrcFastDigest};
56
use criterion::{BenchmarkId, Criterion, Throughput, criterion_group, criterion_main};
67

8+
/// Print platform detection info once at benchmark start.
9+
fn print_platform_info() {
10+
static ONCE: Once = Once::new();
11+
ONCE.call_once(|| {
12+
let tune = platform::tune();
13+
eprintln!("╔══════════════════════════════════════════════════════════════╗");
14+
eprintln!("║ PLATFORM DETECTION INFO ║");
15+
eprintln!("╠══════════════════════════════════════════════════════════════╣");
16+
eprintln!("║ Platform: {}", platform::describe());
17+
eprintln!("║ Tune Kind: {:?}", tune.kind());
18+
eprintln!("║ PCLMUL threshold: {} bytes", tune.pclmul_threshold);
19+
eprintln!("║ SIMD width: {} bits", tune.effective_simd_width);
20+
eprintln!("║ Fast wide ops: {}", tune.fast_wide_ops);
21+
eprintln!("║ Parallel streams: {}", tune.parallel_streams);
22+
eprintln!("╠══════════════════════════════════════════════════════════════╣");
23+
eprintln!("║ Kernel selection by size:");
24+
for &(label, size) in CASES {
25+
eprintln!("║ {:>3} ({:>7} B): {}", label, size, Crc64::kernel_name_for_len(size));
26+
}
27+
eprintln!("╚══════════════════════════════════════════════════════════════╝");
28+
});
29+
}
30+
731
const CASES: &[(&str, usize)] = &[
832
("xs", 64),
933
("s", 256),
@@ -19,6 +43,7 @@ fn make_data(len: usize) -> Vec<u8> {
1943
}
2044

2145
fn bench_crc64_xz_comp(c: &mut Criterion) {
46+
print_platform_info();
2247
let base_rs = Crc64::new();
2348
let base_ref = crc64fast::Digest::new();
2449
let base_fast = CrcFastDigest::new(CrcFastAlgorithm::Crc64Xz);

crates/checksum/src/crc64/config.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,10 +283,11 @@ fn default_pclmul_to_vpclmul_threshold(caps: Caps, tune: Tune) -> usize {
283283
return usize::MAX;
284284
}
285285

286-
// Heuristic default:
287-
// - Fast wide ops (Zen4/5): low crossover.
288-
// - Slow warmup (many Intel parts): require much larger buffers.
289-
if tune.fast_wide_ops { 1024 } else { 16 * 1024 }
286+
// Heuristic default based on benchmarks vs crc-fast-rust:
287+
// - Fast wide ops (Zen4/5): low crossover (512B is sufficient).
288+
// - Slow warmup (Intel SPR/GNR): 2KB is the practical crossover where VPCLMUL wins despite ZMM
289+
// warmup overhead. At 4KB, VPCLMUL is clearly faster.
290+
if tune.fast_wide_ops { 512 } else { 2 * 1024 }
290291
}
291292

292293
#[cfg(not(target_arch = "x86_64"))]

0 commit comments

Comments
 (0)