8000 chtest: fix segments-per-key calculation & add layout explanation by dfinkel · Pull Request #68 · vimeo/galaxycache · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chtest: fix segments-per-key calculation & add layout explanation #68

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
May 5, 2025

Conversation

dfinkel
Copy link
@dfinkel dfinkel commented May 5, 2025
  • chtest: fix segments_per_key calculation
    When writing the initial version of this package, I did a back of the
    envelope calculation, and forgot to draw myself a full diagram for the
    n=2 and n=3 cases, meaning that I didn't actually count how many
    entries I needed with the layout I had. Writing it down and counting
    showed that I was off by a factor of 2. (which also jives with the sizes
    of the internal maps/slices this package creates (which are
    unfortunately only visible in a debugger because they're only propagated
    by the hash-function closure's capture)

  • chtest: add block comment explaining hash layout
    Since I needed to write this down on paper to understand the map myself,
    I might as well add add a doc-comment that explains it in detail for
    everyone. (including future me)

dfinkel added 2 commits May 5, 2025 14:46
When writing the initial version of this package, I did a back of the
envelope calculation, and forgot to draw myself a full diagram for the
n=2 and n=3 cases, meaning that I didn't actually _count_ how many
entries I needed with the layout I had. Writing it down and counting
showed that I was off by a factor of 2. (which also jives with the sizes
of the internal maps/slices this package creates (which are
unfortunately only visible in a debugger because they're only propagated
by the hash-function closure's capture)
Since I needed to write this down on paper to understand the map myself,
I might as well add add a doc-comment that explains it in detail for
everyone. (including future me)
@dfinkel dfinkel merged commit 7f61ec9 into master May 5, 2025
8 checks passed
@dfinkel dfinkel deleted the chtest_segs_per_key_fix branch May 5, 2025 18:58
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
0