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

Get serialized size #429

Merged
merged 5 commits into from
May 10, 2024
Merged

Get serialized size #429

merged 5 commits into from
May 10, 2024

Conversation

AlexanderSaydakov
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented May 9, 2024

Pull Request Test Coverage Report for Build 9037130030

Details

  • 26 of 26 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.962%

Totals Coverage Status
Change from base Build 8399205905: 0.0%
Covered Lines: 16404
Relevant Lines: 16576

💛 - Coveralls

Copy link
Contributor

@jmalkin jmalkin left a comment

Choose a reason for hiding this comment

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

The new test is a little strange to me but not unreasonable. Seems inefficient but I guess that's ok.

@AlexanderSaydakov
Copy link
Contributor Author

Perhaps I could explain in the test. The sketch reaches capacity for the first time at 2 * K * 15/16, but at that point it is still in exact mode, so the serialized size is not the maximum (theta in not needed in the exact mode). So we need to catch the second time, but some updates will be ignored in the estimation mode, so I updated more than enough times keeping track of the maximum. Perhaps I should have figured out the exact number of updates given this particular sequence, but not assuming that might be even better (say, in case we change the load factor or just out of principle not to rely on implementation details too much).

@jmalkin
Copy link
Contributor

jmalkin commented May 10, 2024

Yeah, the test is fine. It just feels sort of overkill to serialize after every update just to check. Not quite an ideal design for quick tests but with lgK=10 it should be ok in practice.

@AlexanderSaydakov AlexanderSaydakov merged commit 85254b7 into master May 10, 2024
8 checks passed
@AlexanderSaydakov AlexanderSaydakov deleted the get_serialized_size branch May 10, 2024 19:42
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