4 ms·
The two JITs are completely different. LLVM uses method level inlining, and doesn't do too well with removal of GC malloc calls, or at least it doesn't do this
by _halgari 12y ago
The two JITs are completely different. LLVM uses method level inlining, and doesn't do too well with removal of GC malloc calls, or at least it doesn't do this by default.
RPython's JITs however, are tracing jits. They trace from the start, to the end of a loop, and inline all methods along the way, then remove all conditional jumps (replacing them with guards), then remove all unneeded mallocs, and then optimizes everything else it can. The end result is a trace that is highly optimized for that one path through the code. Thus, if your code is highly polymorphic, but only ever uses a certain path through the code, RPython jits can out-perform C++ in some rare cases, and can probably outperform most custom jits in many cases.
Some links to read:
http://en.wikipedia.org/wiki/Tracing_just-in-time_compilation http://en.wikipedia.org/wiki/Tracing_just-in-time_compilatio...
http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-again-string.html http://morepypy.blogspot.com/2011/08/pypy-is-faster-than-c-a...