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

chore: restore bitCount32 test #489

Merged
merged 3 commits into from
Feb 25, 2024
Merged

chore: restore bitCount32 test #489

merged 3 commits into from
Feb 25, 2024

Conversation

EvanHahn
Copy link
Contributor

This change is not urgent.

bitCount32's test is skipped because it is slow, and it's slow because it iterates over all integers between 0 and 232.

This keeps that test skipped but adds a new test that we can run, which only tests a few inputs. It also speeds up the test-only comparison function by about 9x in my testing.

bitCount32's test is skipped because it is slow, and it's slow because
it iterates over all integers between 0 and 2^32.

This keeps that test skipped but adds a new test that we can run, which
only tests a few inputs. It also speeds up the test-only comparison
function by about 9x in my testing.
Copy link
Member

@gmaclennan gmaclennan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Was initially hesitant because the idea of the test/comparison bit count is something so simple it doesn't need a test itself, and bitwise functions scare me, but re-reading the slowBitCount function, I think it's obvious enough to be used as a test comparison case.

Looks good to me.

@EvanHahn EvanHahn merged commit ee5233f into main Feb 25, 2024
7 checks passed
@EvanHahn EvanHahn deleted the restore-bitCount32-test branch February 25, 2024 22:30
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