-
-
Notifications
You must be signed in to change notification settings - Fork 460
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
Hashing tests #5026
base: master
Are you sure you want to change the base?
Hashing tests #5026
Conversation
the tests are adequate but I am not satisfied with my attempt at improving performance before:
after:
we see the total improvement over all 3 tests is negligible because while the first two are faster the last is much slower. |
I still think we need to limit the size of the input field, as there's no reasonable explanation for having more than, say, 100,000 cards in a deck. |
I agree, I'm thinking of whether to make it a per node limit (easy to implement), or a total card limit, but I think it should be a limit on the deck itself, not just the hash. |
// all cards are sorted, yet as all cards are made lower case and SB: is added to all sideboard cards, they will | ||
// always sort before mainboard cards | ||
|
||
for (auto rootIter = root->cend() - 1, rootEnd = root->cbegin() - 1; rootIter != rootEnd; --rootIter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the benefit of this over for (auto rootValue : root)
?
for (auto i = sbCardList.cbegin(), end = sbCardList.cend(); i != end; ++i) { | ||
for (int j = 0; j < i.value(); ++j) { | ||
if (started) { | ||
hasher.addData(";SB:"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does CPP not have a ";".join(sbCardList)
equiv?
Related Ticket(s)
Short roundup of the initial problem
There are no tests that verify the deck hasher remains the same.
What will change with this Pull Request?