Skip to content

Instantly share code, notes, and snippets.

@kif
Last active October 17, 2024 14:18
Show Gist options
  • Save kif/ace15da5acfa495efaf3d37feb701a17 to your computer and use it in GitHub Desktop.
Save kif/ace15da5acfa495efaf3d37feb701a17 to your computer and use it in GitHub Desktop.
Comparison of (pseudo-) random number generators
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sdebionne
Copy link

Numpy is even fast !

MKL Random generators, that leverage the Vector Statistics Random Number Generators of modern CPUs, or whatever mathematical library is used to implement Numpy is fast. You are comparing Numpy's implementation, dedicated to array data structures (contiguous in memory) that are perfect candidate for vector (SIMD) implementation, to standard libraries implementation that make no assumption whatsoever. It's not about languages, it's about using the right tools for the use case. Here it looks like Numpy is the right tool -or give you an easy interface to it.

Yes, it's trolling Friday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment