You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::rand::random is quite slow, since it has to do a TLD look-up to find the task_rng, and only then generate the random number. The docs should mention that if random is called repeatedly, one should do a single look-up via the task_rng() function, and then call the Rng methods directly.
E.g.
for x in foo.mut_iter(){*x = rand::random()}// would be faster asletmut rng = rand::task_rng();for x in foo.mut_iter(){*x = rng.gen();}