Skip to content

fix: make read_from_internal_position inline#149

Merged
spaskalev merged 1 commit intospaskalev:mainfrom
theVerySharpFlat:main
Dec 5, 2025
Merged

fix: make read_from_internal_position inline#149
spaskalev merged 1 commit intospaskalev:mainfrom
theVerySharpFlat:main

Conversation

@theVerySharpFlat
Copy link
Contributor

read_from_internal_position is essentially a wrapper for bitset_count_range, so inlining here makes sense.

Interestingly, this improves my buddy_bench time by about half a second!

@spaskalev
Copy link
Owner

The myth about compilers being smart is busted once again, eh :) I dislike how I had to violate the neat position abstraction in the find free function and go deep with the internal read but that also was a significant performance improvement.

Thanks for looking into it!

@theVerySharpFlat
Copy link
Contributor Author

theVerySharpFlat commented Dec 5, 2025

The myth about compilers being smart is busted once again

right? This is sort of similar to the previous patch. I expected the compiler (gcc 15, mind you) to inline memset, but here we are. And you would almost expect -O3 to violate user inline hints to improve performance.

Thanks for looking into it!

Of course! Thanks for the quick reply!

@spaskalev spaskalev merged commit 2e7b143 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