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

Simplify IDGenerator and reduce collission rate #223

Merged

Commits on Aug 8, 2024

  1. Simplify IDGenerator and reduce collission rate

    Since offset is always truncated to s.numBuckets, atomic.Add could be
    used instead of atomic.Load + atomic.Swap
    
    Also offsetting bucket by 1 does not give lot's of space for collission
    avoidance.
    If first call hits bucket that is fully in use, second call going to share same bucket with first call.
    dkropachev committed Aug 8, 2024
    Configuration menu
    Copy the full SHA
    a0de29d View commit details
    Browse the repository at this point in the history