zeromq / azmq

C++ language binding library integrating ZeroMQ with Boost Asio
Boost Software License 1.0
318 stars 108 forks source link

socket ops: use taus88 instead of mersenne_twister #180

Closed timblechmann closed 3 years ago

timblechmann commented 3 years ago

mt19937 is a great rng, but it requires a rather large state. taus88 is a very decent rng with a much smaller memory footprint

aboseley commented 3 years ago

I'm not familiar with taus88 This page : https://www.boost.org/doc/libs/1_77_0/doc/html/boost_random/performance.html

Lists it as the fastest rng, slightly faster than mt19937.

aboseley commented 3 years ago

This project lists support back to Boost 1.48 , I wonder if taus88 is supported in that version

aboseley commented 3 years ago

Looks like it's supported in boost 1.48. Do you have any references to its smaller memory footprint?

timblechmann commented 3 years ago

https://www.boost.org/doc/libs/1_77_0/doc/html/boost_random/reference.html#boost_random.reference.generators

3*sizeof(uint32_t) instead of 625*sizeof(uint32_t) (it's based on xor-ing three linear-feedback shift registers)