I'm working on an algorithm which needs to generate millions of numbers as fast as possible. Actually I found out that the rand() function of my algorithm takes 75% of the process time.
So I'm looking for something faster. And I don't need a big range at all. (I only need integer numbers below 1000)
Do you know something I could use ?
Thanks !
Edit :
I use this numbers for shuffling groups of less than 1000 entities.
I found out more about the "fast rand". And there is SSE version version which is even faster and generates 4 numbers at a time.
https://software.intel.com/en-us/articles/fast-random-number-generator-on-the-intel-pentiumr-4-processor/
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…