Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information