4 ms·
I did a quick speed comparison: import numpy as np import time n = time.time()*1000 r = np.random.rand(10000000)**2 print('done in', time.time()
by doctoboggan 5y ago
I did a quick speed comparison:
import numpy as np
import time
n = time.time()*1000
r = np.random.rand(10000000)**2
print('done in', time.time()*1000-n, 'ms')
In the browser I was getting around 200ms and on my computer I was getting around 65ms, so around 3 times slower.
Also, if I try to allocate an array of length 100,000,000 then I get a `MemoryError` in the browser.
Does anyone know any ways to get around these limitations?
- deleted 5y ago[deleted]
- ledauphin 5y agothat's... really not bad at all. Kind of amazing, in fact. Thanks for putting in the work.
- tomatowurst 5y agothis is coincidentally really freaking good. to be able to run numpy in a browser without having to rely on javascript port? and its only about 3 times slower? I can live with this for now and i think this will improve drastically in the future
- hoten 5y agoDepending on how the wasm was compiled, there are options to limit or prevent memory growth. But I think the total limit at the moment is 4gb because 32bit.