Skip to content

Conversation

@spaskalev
Copy link
Owner

@spaskalev spaskalev commented Sep 26, 2025

As suggested in #145 the depth_for_size function can be implemented without the loop. The chosen count_trailing_zeroes is not the fastest one out there but its simplicity makes it preferable.

@spaskalev spaskalev merged commit b19cb73 into main Sep 26, 2025
6 checks passed
@spaskalev spaskalev deleted the faster-depth-for-size branch September 26, 2025 17:31
@theVerySharpFlat
Copy link
Contributor

As mentioned in #145, the original implementation took 17s on buddy_bench. The intrinsic version I drummed up took 13s. This PR takes 14s. Pretty good considering it's also portable!

@spaskalev
Copy link
Owner Author

@theVerySharpFlat thanks for the report and for testing the pr too! It is nice to have more eyes on the code.

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.

3 participants