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

perf(internal/bits): Speedup extended commit.BitArray() (backport #29… #43

Merged
merged 1 commit into from
May 3, 2024

Commits on May 2, 2024

  1. perf(internal/bits): Speedup extended commit.BitArray() (backport com…

    …etbft#2959) (cometbft#2983)
    
    Speedup ExtendedCommit.BitArray() by making a direct constructor that
    does not go through mutexes. I expect this to be a 10x performance
    improvement. (It also removes the duffcopies and reduces setIndex
    proportion of time here)
    
    This removes this time (which is mostly coming from mutex calls): 
    
    ![image](https://github.com/cometbft/cometbft/assets/6440154/da11d57d-6bea-40ea-a0fa-9209ea3e22f8)
    
    Later on we should instead make an API that lets us randomly sample from
    a bit array with no bit array copying needed. (But that makes the
    interface messier)
    
    ---
    
    #### PR checklist
    
    - [x] Tests written/updated
    - [x] Changelog entry added in `.changelog` (we use
    [unclog](https://github.com/informalsystems/unclog) to manage our
    changelog)
    - [x] Updated relevant documentation (`docs/` or `spec/`) and code
    comments
    - [x] Title follows the [Conventional
    Commits](https://www.conventionalcommits.org/en/v1.0.0/) spec
    <hr>This is an automatic backport of pull request cometbft#2959 done by
    [Mergify](https://mergify.com).
    
    ---------
    
    Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
    Co-authored-by: Anton Kaliaev <anton.kalyaev@gmail.com>
    3 people authored and czarcas7ic committed May 2, 2024
    Configuration menu
    Copy the full SHA
    74e25a3 View commit details
    Browse the repository at this point in the history