Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Reduce memory copying operations in bech32 encoding #29607

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Jun 5, 2024

  1. Configuration menu
    Copy the full SHA
    d5ece3c View commit details
    Browse the repository at this point in the history
  2. Reduce memory copying operations in bech32 encode

    Here I've reduced the memory reallocations and copying operations in bech32 encode, making it ~15% faster.
    
    make && ./src/bench/bench_bitcoin --filter='Bech32Encode' --min-time=1000
    
    Before:
    
    |             ns/byte |              byte/s |    err% |     total | benchmark
    |--------------------:|--------------------:|--------:|----------:|:----------
    |               19.97 |       50,074,562.72 |    0.1% |      1.06 | `Bech32Encode`
    After:
    
    |             ns/byte |              byte/s |    err% |     total | benchmark
    |--------------------:|--------------------:|--------:|----------:|:----------
    |               17.33 |       57,687,668.20 |    0.1% |      1.10 | `Bech32Encode`
    
    Co-authored-by: josibake <josibake@protonmail.com>
    paplorinc and josibake committed Jun 5, 2024
    Configuration menu
    Copy the full SHA
    07f6417 View commit details
    Browse the repository at this point in the history