Hacker News new | ask | show | jobs
by sprite 2540 days ago
Would love to see the 3ms solution. Post a gist if you have it available.
1 comments

Sure. Here's a gist with 3 versions (original, the 25ms version and the 3ms version): https://gist.github.com/nickjj/99ea84f460f41dae4139d0610ce80...

The reason I didn't use the 3ms version was due to it having too many concepts that are unknown to me. At the end of the day I would still need to maintain the code and the 25ms version is a lot easier to change (for me at least).

But, if I had very strict time requirements, I could just drop in the 3ms version at any time to get the speed boost which I think is reasonable. I only need to bring in the operational complexity when the demand calls for it. Otherwise the more human readable version is fast enough for my use case.

I suspect the 3ms version is still hamstrung by the system rng :) I might try to make it even faster if you don't mind!!
Sure, go nuts. Feel free to ping me on Twitter at @nickjanetakis and / or reply here if you can improve it.
Thanks.