Share your repls and programming experiences

← Back to all posts
Random Number Optimizations
FriendlyGooseMan

I have optimized random number generation to be about 0.00001260415 per number (abt 6 seconds for 500K) but I think the reply community can take this further. The rules for this "Challenge" are
1. Must be in python (even if it is slow)
2. You must generate 500K numbers
3. The number must be min 1 and max 10000.
and that's it. I know the repl community is insane with their skill so I want to see what you guys can do with this. The reason I am doing this is because random generation on mass scales in python is useless. so we should optimize it to make it super fast AND useless. (although this is really just for fun)

Lets see how much you can optimize it winner gets a sticker :O

Voters
FriendlyGooseMan
Comments
hotnewtop
Spacecraft

~3 seconds for 500k

FriendlyGooseMan

@Spacecraft Nice thats ~2 second drop.

FriendlyGooseMan

@FriendlyGooseMan able to drop it to ~1.5-2 seconds

This is better because it is in a function and local is always faster is something that someone taught me.