Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When many UUIDs are being generated concurrently, contention on the atomic counter can slow things down. There might be ways to speed this up, but for now, just add a parallel benchmark so we can measure the baseline. Initial results with `go test -bench . -cpu 1,2` on my machine (two physical cores): BenchmarkContended 56413502 18.3 ns/op BenchmarkContended-2 82533951 33.5 ns/op Note that the 33.5ns/op measure is worse than it appears, because that's wall ns/op, not cpu-ns/op (see golang/go#31884), so the time is actually 67.0ns/op when contended.
- Loading branch information