Hi,

jfcg/rng <https://github.com/jfcg/rng/> v0.7.0 is just released. It has the 
following advantages (std=math/rand, alt=golang.org/x/exp/rand):

Effective Entropy (hidden information, in bits):
rng: 128
std: 31
alt: 64

Used memory (in bytes):
rng: 24
std: 4920
alt: 48

Benchmarks:
goos: linux
goarch: amd64
pkg: github.com/jfcg/rng/bench
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?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/4c245a3f-12b4-4573-9826-7b86ed0e05fan%40googlegroups.com.

Reply via email to