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

Reimplement newBitboard to avoid string operations #105

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bbars
Copy link
Contributor

@bbars bbars commented Jul 12, 2022

Instead of building a string of "0"s and "1"s and then converting it,
newBitboard now uses bit arithmetic to convert a map to a uint64. This
avoids memory allocation and a bunch of string operations.
Add test for this change.

Done by @tov
Original PR: #75

Instead of building a string of "0"s and "1"s and then converting it,
newBitboard now uses bit arithmetic to convert a map to a uint64. This
avoids memory allocation and a bunch of string operations.
Add test for this change.

Done by @tov: https://github.com/tov
Original PR: notnil#75
@notnil
Copy link
Owner

notnil commented Aug 8, 2022

My test is failing @bbars .

--- FAIL: TestBitboardNew (0.00s)
    bitboard_test.go:110: new bitboard from map[a1:true] expected 1000000000000000000000000000000010000000000000000000000000000000 but got 1000000000000000000000000000000000000000000000000000000000000000

Also I updated Github actions to run tests on PRs now (I believe).

@bbars
Copy link
Contributor Author

bbars commented Aug 12, 2022

@notnil, I'm sorry, it's my fault. There was a typo in the expectation. I've fixed it.
Also we can see now, that test were run successfully on PR.

@bbars bbars requested a review from sumnerevans March 3, 2023 16:41
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