4 ms·
No comment on the poor implementations (why quadratic complexity, in all three cases?), but some general notes: For reporting benchmarks, you probably want the
by Radim 9y ago
No comment on the poor implementations (why quadratic complexity, in all three cases?), but some general notes:
For reporting benchmarks, you probably want the minimum, rather than average. While keeping an eye on the distribution/variation of the individual timings as well (to mitigate caching effects). Check out Python's timeit module or the %timeit magic command in IPython.
With more numeric-heavy workflows, the gap between Python/C grows even larger. The more you can push to native-compiled-land, away from Python loops, the better. As another data point, when optimizing the word2vec algorithm, the numbers came out something like [0]:
1x (pure Python) - ~120x (NumPy) - ~2880x (C/Cython)
[0] https://rare-technologies.com/word2vec-in-python-part-two-optimizing/ https://rare-technologies.com/word2vec-in-python-part-two-op...