4 ms·
Shouldn't be too surprising, given how PyPy is generally faster than CPython by about x7-8 factor: http://speed.pypy.org/ http://speed.pypy.org/ I'd expect a
by dunpeal 8y ago
Shouldn't be too surprising, given how PyPy is generally faster than CPython by about x7-8 factor:
http://speed.pypy.org/ http://speed.pypy.org/
I'd expect a much larger difference in tasks that are pure Python (loading a CSV is done primarily through the csv module, i.e. all the hot loops are in C).
- icebraining 8y agoYes, but PyPy is usually compiled to machine code (and emits machine code), not to JS.
- make3 8y agoI love Python but js is close to an order of magnitude faster
- icebraining 8y agoHave you tried PyPy?
- dunpeal 8y agoIndeed, but many of the optimizations introduced by PyPy should be visible regardless of compilation target.
- azakai 8y agoTrue, but the asm.js is then compiled to machine code by the browser's JS JIT. I'd expect some overhead from sandboxing etc., but it should be fairly close to native speed.
- ris 8y agoIt's not "overhead from sandboxing" that's a problem, it's the fact that translating from bytecode to bytecode to bytecode will cause it to lose some ... succinctness at each step, giving the final machine code generator a harder time coming up with efficient code for it.