3 ms·
I did a small test, here's the gist:https://gist.github.com/arnists/a9f19af5d9469549020e https://gist.github.com/arnists/a9f19af5d9469549020e Seems like a huge
by Beltiras 11y ago
I did a small test, here's the gist:https://gist.github.com/arnists/a9f19af5d9469549020e https://gist.github.com/arnists/a9f19af5d9469549020e
Seems like a huge improvement, don't know if it's the recent additions or in general pypy vs cpython but it's enough of a speed bump to sit up and take note.
- lqdc13 11y agoThat's why you don't use pure python for this. Here is your test done using numpy import numpy as np %timeit sum(np.sum(np.random.randint(0, 10000000, 5000)) for i in range(5000)) 1 loops, best of 3: 586 ms per loop
- Beltiras 11y agoI was mostly getting a comparison between cpython and pypy, less concerned with numpy vs cpython.
- lqdc13 11y agoSure, but my point is that it's not a relevant comparison. A relevant comparison is counting words or something like that. Things people don't have an easy way to do much faster.