-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Docs for std::rand::random should discuss performance #16072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
👍 |
This kind of thing wouldn't be an issue with a fast TLS implementation though. LLVM knows how to perform optimizations on real TLS. |
What's the story with this today? the removal of libgreen means that TLS got redone, correct? |
steveklabnik
added a commit
to steveklabnik/rust
that referenced
this issue
Jan 12, 2015
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this issue
Jan 15, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
std::rand::random
is quite slow, since it has to do a TLD look-up to find thetask_rng
, and only then generate the random number. The docs should mention that ifrandom
is called repeatedly, one should do a single look-up via thetask_rng()
function, and then call theRng
methods directly.E.g.
The text was updated successfully, but these errors were encountered: