numpy performance and random numbers

Lie Ryan lie.1296 at gmail.com
Sat Dec 19 15:26:03 EST 2009


On 12/20/2009 4:02 AM, Carl Johan Rehn wrote:
>>>> How did you time it?
>
> Well, in Matlab I used "tic; for i = 1:1000, randn(100, 10000), end;
> toc" and in IPython i used a similar construct but with "time" instead
> of tic/(toc.

Code?

>>>> Parallel PRNGs are an unsolved problem in computer science.
>
> Thanks again for sharing your knowledge. I had no idea. This means
> that if I want to speed up my application I have to go for the fastest
> random generator and focus on other parts of my code that can be
> vectorized.

If you don't care about "repeatability" (which is already extremely 
difficult in parallel processing even without random number generators), 
you can just start two PRNG at two distinct states (and probably from 
two different algorithms) and they will each spews out two independent 
streams of random numbers. What was "unsolved" was the "pseudo-" part of 
the random number generation, which guarantee perfect replayability in 
all conditions.



More information about the Python-list mailing list