|
|
|
|
|
by thisguy47
2548 days ago
|
|
Am I missing something? With numpy on my 2017 Macbook Pro, I can generate 1B random, normally distributed numbers on a CPU in ~1.3 microseconds. In [3]: %timeit np.random.normal(1000000000) 1.3 µs ± 26.2 ns per loop (mean ± std. dev. of 7 runs, 1000000 loops each) Edit: and 2.5e17 in ~7.95 microseconds In [5]: %timeit np.random.normal((500000000, 500000000)) 7.95 µs ± 90.7 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each) |
|
I get results about 100x slower those of the article's CPU benchmark when using numpy on a 2019 MBP:
edit: I'm no python wizard myself, so I'm perfectly willing to believe that there's a better way to generate a random array in numpy than what I'm doing.