3 ms·
An example of how, for certain types of code, more than an order-of-magnitude performance improvement can be obtained with a good JIT compiler. I wrote a decomp
by bakery2k 10y ago
An example of how, for certain types of code, more than an order-of-magnitude performance improvement can be obtained with a good JIT compiler. I wrote a decompression routine (for a simple compression format) in several languages - it took the following lengths of time to run (normalized to C++ = 1 second):
* CPython, Jython, Lua, MicroPython, Ruby (1.8): >100 seconds
* Cython (naive), IronPython, Ruby (2.3): 50 - 80 seconds
* LuaJIT, PyPy, Cython (with type hints): ~4 seconds
* C#, Go, JavaScript (V8): ~1.5 seconds
- Jcol1 10y agocan you try it in julia?
- bakery2k 10y agoI actually wrote a Julia version at the time, but it was difficult to accurately benchmark because the total runtime was significantly affected by a long (~5 seconds) delay at startup. Recently, however, I came across https://www.reddit.com/r/Julia/comments/4c09m1/ https://www.reddit.com/r/Julia/comments/4c09m1/, which suggests running with `--precompiled=yes` to reduce startup time. I have now run the Julia version with that command-line option, and the runtime is impressive - comparable to C#/Go/V8.
- Jcol1 10y agoVery cool
- tavert 10y agoMost Julia users run code more often in an interactive REPL session rather than as a script to do a single thing. The precompiled code loading is now on by default on Windows in Julia 0.5 since the backtrace issue was fixed, but there's still a 0.3-0.5 second delay on startup at the moment.