Skip to content

Conversation

@theVerySharpFlat
Copy link
Contributor

@theVerySharpFlat theVerySharpFlat commented Dec 5, 2025

Hello again!
The current implementations of bitset_set_range and bitset_clear_range use while loops and set bytes individually. Often, the system's standard c library will include system-specific optimizations with memset.

Speedups are a lot more humble than my previous suggestion, but the implementation is cleaner!

(buddy_bench numbers from Release configuration, zen4)
before: 11.580 with around 0.050s variance over 10 runs
after:  11.280 with around 0.050s variance over 10 runs

@spaskalev
Copy link
Owner

Thanks. Can you make it != 0 so that CodeQL doesn't complain ?

@theVerySharpFlat
Copy link
Contributor Author

theVerySharpFlat commented Dec 5, 2025

yeah, just force pushed. Oh, do you prefer != 0 over just empty?

@spaskalev
Copy link
Owner

This works too :))

@spaskalev spaskalev merged commit 1a842b9 into spaskalev:main Dec 5, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants