• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rust-bitcoin / rust-bitcoin / 9044291183
83%

Build:
DEFAULT BRANCH: master
Ran 11 May 2024 02:17PM UTC
Jobs 1
Files 92
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

11 May 2024 02:16PM UTC coverage: 83.195% (-0.01%) from 83.208%
9044291183

push

github

apoelstra
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

  ![image](https://github.com/rust-bitcoin/rust-bitcoin/assets/6470319/30883c6b-7627-4ad0-aa91-373f22393f26)

  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

Jobs
ID Job ID Ran Files Coverage
1 9044291183.1 11 May 2024 02:17PM UTC 0
83.2
GitHub Action Run
Source Files on build 9044291183
Detailed source file information is not available for this build.
  • Back to Repo
  • Github Actions Build #9044291183
  • 89d6991c on github
  • Prev Build on master (#9024166987)
  • Next Build on master (#9063105280)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc