Skip to content

Use countTrailingZeros for indexOfTheOnlyBit #379

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

Merged
merged 2 commits into from
Jul 24, 2019
Merged

Conversation

alexbiehl
Copy link
Member

@alexbiehl alexbiehl commented Jan 3, 2017

This is an experiment for indexOfTheOnlyBit. I haven't benchmarked yet. But will do so tonight.

@alexbiehl
Copy link
Member Author

I forgot about this one! Here you can see the benchmarks https://gist.github.com/alexbiehl/ed33c0cc7f009fc647606e9b88bf9e9c/revisions (left is original, right is with these patches)

@treeowl
Copy link
Contributor

treeowl commented Dec 18, 2017

@alexbiehl, what's with the regressions in list conversion functions?

@treeowl
Copy link
Contributor

treeowl commented Jan 22, 2018

I'm sorry I lost track of this. The benchmark numbers you posted look very good, but unfortunately I haven't been able to reproduce your results. Part of the problem may be the general flakiness of the incredibly short benchmarks. Can you suggest a procedure for getting good results reliably?

@alexbiehl
Copy link
Member Author

alexbiehl commented Jan 23, 2018

Me neither! I went ahead and further "optimized" the folds by using Count{Leading, Trailing}Zeros but the effect was basically nil. I suggest we abandon this for now.

Edit: Yes I could try to make longer, more reliable benchmarks first, will do that.

@treeowl
Copy link
Contributor

treeowl commented Jan 23, 2018

All right. Let me know. We could use more reliable benchmarks regardless of what happens to this PR.

@treeowl
Copy link
Contributor

treeowl commented Jul 22, 2019

Do you think you could rebase this? @Fuuzetsu did some benchmarking and found that it at least doesn't seem to hurt. It's definitely less messy and cuts code size in key places.

@alexbiehl
Copy link
Member Author

alexbiehl commented Jul 22, 2019 via email

@alexbiehl
Copy link
Member Author

@treeowl Done!

@treeowl treeowl merged commit 403cf3c into haskell:master Jul 24, 2019
@treeowl
Copy link
Contributor

treeowl commented Jul 24, 2019

Thanks!

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