goos: linux
goarch: amd64
cpu: Intel(R) Xeon(R) Platinum 8272CL CPU @ 2.60GHz
BenchmarkGet-2 227183912 5.259 ns/op
BenchmarkStdGet-2 267202182 4.497 ns/op
BenchmarkAltGet-2 310959830 3.859 ns/op
BenchmarkExp-2 50470122 23.13 ns/op
BenchmarkStdExp-2 170507682 7.035 ns/op
BenchmarkAltExp-2 162541906 7.387 ns/op
BenchmarkOne-2 228389506 5.248 ns/op
BenchmarkStdOne-2 295455202 4.070 ns/op
BenchmarkAltOne-2 182677640 6.516 ns/op
BenchmarkNormal-2 25363636 46.07 ns/op
BenchmarkStdNormal-2 153550454 7.854 ns/op
BenchmarkAltNormal-2 145823773 8.228 ns/op
BenchmarkTwo-2 228640303 5.243 ns/op
Let me know what you think,
Thanks..
Notes:
- rng tries to be very small & fast
- rng ignores locking by design & compared with lockless std/alt
- rng does not have pseudo-rng yet, just the global one
- rng does not have all API like Perm yet
- rng does not have advanced table-based Exp/Normal like std/alt, hence quite slower for those
- rng.Normal returns two samples, so it is as fast as rng.Exp per sample
- rng is not throughly analized
Questions:
- Can you estimate the length of shortest cycle for rng state?
- Does rng mix bits good enough?