|
Ran
|
Jobs
1
|
Files
92
|
Run time
1min
|
Badge
README BADGES
|
push
github
Merge rust-bitcoin/rust-bitcoin#2759: Bench `base58` encoding and remove `SmallVec` to improve perf 464669052 fix clippy lint by using resize instead of push (Riccardo Casatta) deeb160b8 remove SmallVec (Riccardo Casatta) e4b707ba8 add bench for base58::encode_check (Riccardo Casatta) Pull request description: In a downstream app I've seen printing a descriptor is not a cheap operation, analyzing the flamegraph it seems base58 encoding of the xpub is the culprit  This PR adds benches for the `encode_check` function, and add the changes gaining more boost, which is also good cause it removes code. Other attempts didn't provide enough benefit for inclusion but I report them here for knowledge. ``` ## baseline running 2 tests test benches::bench_encode_check_50 ... bench: 8,760 ns/iter (+/- 113) test benches::bench_encode_check_xpub ... bench: 19,982 ns/iter (+/- 109) ## remove smallvec running 2 tests test benches::bench_encode_check_50 ... bench: 7,935 ns/iter (+/- 129) test benches::bench_encode_check_xpub ... bench: 18,076 ns/iter (+/- 184) ## increase smallvec to 128 (fits xpub) test benches::bench_encode_check_50 ... bench: 8,786 ns/iter (+/- 738) test benches::bench_encode_check_xpub ... bench: 20,006 ns/iter (+/- 2,611) ## avoid char-to-str by keeping str map test benches::bench_encode_check_50 ... bench: 7,895 ns/iter (+/- 88) test benches::bench_encode_check_xpub ... bench: 17,883 ns/iter (+/- 118) ``` Gains are good (~10%), but I don't think they explains the 3ms to print a descriptor in wasm env, probably is the sha256 for the checksum is fast in cargo bench but slow in wasm env, but I didn't research on the topic. ACKs for top commit: ... (continued)
5 of 5 new or added lines in 1 file covered. (100.0%)
19174 of 23047 relevant lines covered (83.2%)
16814.36 hits per line
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | 9044291183.1 | 0 |
83.2 |
GitHub Action Run |