This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dyedgreen
Recipients dyedgreen, mark.dickinson, rhettinger
Date 2019-11-11.17:08:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1573492126.38.0.315773504148.issue38767@roundup.psfhosted.org>
In-reply-to
Content
Currently, the `random.random()` function / the random module uses the Mersenne Twister algorithm for generating random numbers.

While this algorithm has acceptable statistical properties for most use-cases (and does feature a ridiculously large period), it is slow and very memory intensive when compared with algorithms from the PCG family (see http://www.pcg-random.org). PCG family algorithms also have much better statistical properties than the Mersenne Twister.

I would propose to replace the underlying generator in `random` with a suitable PCG family algorithm, while not changing any of the external interfaces of the module. I think that the change would make the module faster, better in terms of memory usage, and improve the statistical properties of Python's default random numbers.

I have not done anything in the direction in terms of writing any code, but if this sounds like something that would be sensible, I would be happy to work on the change and submit a PR.

Also, this is the first time I am contributing to Python/ writing an issue here, so apologies if this is not the correct place to make a suggestion like this.
History
Date User Action Args
2019-11-11 17:08:46dyedgreensetrecipients: + dyedgreen, rhettinger, mark.dickinson
2019-11-11 17:08:46dyedgreensetmessageid: <1573492126.38.0.315773504148.issue38767@roundup.psfhosted.org>
2019-11-11 17:08:46dyedgreenlinkissue38767 messages
2019-11-11 17:08:45dyedgreencreate