Skip to content

Commit 7e9be66

Browse files
author
LongYinan
committed
docs: add benchmark result in README
1 parent c66281b commit 7e9be66

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

packages/crc32/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,41 @@
44

55
Fastest `crc32` implement in `NodeJS`
66

7+
The 4 tested implementations are:
8+
9+
- **@node-rs/crc32** Hardware accelerated CRC-32C from [crc32fast](https://crates.io/crates/crc32fast)
10+
- **sse4_crc32c** Hardware accelerated CRC-32C from [sse4_crc32](https://github.com/Voxer/sse4_crc32)
11+
- **js_crc32c** Javascript implemented CRC-32C
12+
- **js_crc32** Javascript implemented CRC-32 from [buffer-crc32](https://github.com/brianloveswords/buffer-crc32)
13+
14+
# Performance
15+
16+
```bash
17+
sse4_crc32c_node_rs for inputs 1024B x 5,108,123 ops/sec ±1.86% (89 runs sampled)
18+
sse4_crc32c_node_rs for inputs 16931844B, avg 2066B x 271 ops/sec ±1.15% (85 runs sampled)
19+
sse4_crc32c_hw for inputs 1024B x 3,543,443 ops/sec ±1.39% (93 runs sampled)
20+
sse4_crc32c_hw for inputs 16931844B, avg 2066B x 209 ops/sec ±0.78% (76 runs sampled)
21+
sse4_crc32c_sw for inputs 1024B x 1,460,284 ops/sec ±2.35% (90 runs sampled)
22+
sse4_crc32c_sw for inputs 16931844B, avg 2066B x 93.50 ops/sec ±2.43% (69 runs sampled)
23+
js_crc32c for inputs 1024B x 464,681 ops/sec ±0.46% (91 runs sampled)
24+
js_crc32c for inputs 16931844B, avg 2066B x 28.25 ops/sec ±1.64% (51 runs sampled)
25+
js_crc32 for inputs 1024B x 442,272 ops/sec ±2.66% (93 runs sampled)
26+
js_crc32 for inputs 16931844B, avg 2066B x 22.12 ops/sec ±5.20% (40 runs sampled)
27+
+---------------------+-------------------+----------------------+
28+
| │ 1024B │ 16931844B, avg 2066B |
29+
+---------------------+-------------------+----------------------+
30+
| sse4_crc32c_node_rs │ 5,108,123 ops/sec │ 271 ops/sec |
31+
+---------------------+-------------------+----------------------+
32+
| sse4_crc32c_hw │ 3,543,443 ops/sec │ 209 ops/sec |
33+
+---------------------+-------------------+----------------------+
34+
| sse4_crc32c_sw │ 1,460,284 ops/sec │ 93.50 ops/sec |
35+
+---------------------+-------------------+----------------------+
36+
| js_crc32c │ 464,681 ops/sec │ 28.25 ops/sec |
37+
+---------------------+-------------------+----------------------+
38+
| js_crc32 │ 442,272 ops/sec │ 22.12 ops/sec |
39+
+---------------------+-------------------+----------------------+
40+
```
41+
742
# Support matrix
843

944
| | node 10 | node12 | node13 | node14 |

0 commit comments

Comments
 (0)