Message356371
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. |
|
Date |
User |
Action |
Args |
2019-11-11 17:08:46 | dyedgreen | set | recipients:
+ dyedgreen, rhettinger, mark.dickinson |
2019-11-11 17:08:46 | dyedgreen | set | messageid: <1573492126.38.0.315773504148.issue38767@roundup.psfhosted.org> |
2019-11-11 17:08:46 | dyedgreen | link | issue38767 messages |
2019-11-11 17:08:45 | dyedgreen | create | |
|