TinyMT pseudo random number generator for Erlang

  • Authors:
  • Kenji Rikitake

  • Affiliations:
  • Kyoto University, Kyoto, Japan

  • Venue:
  • Proceedings of the eleventh ACM SIGPLAN workshop on Erlang workshop
  • Year:
  • 2012

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper is a case study of implementing Tiny Mersenne Twister (TinyMT) pseudo random number generator (PRNG) for Erlang. TinyMT has a longer generation period (2127-1) than the stock implementation of Erlang/OTP random module. TinyMT can generate multiple independent number streams by choosing different generation parameters, which is suitable for parallel generation. Our test results of the pure Erlang implementation show the execution time of RNG generating integers with TinyMT is approximately two to six times slower of that with the stock random module. Additional implementation with Native Interface Functions (NIFs) improved the execution speed to approximately three times as faster than that of the random module. The results suggest TinyMT will be a good candidate as an alternative PRNG for Erlang, regarding the increased period of the RNG and the benefit of generating parallel independent random number streams.