in reply to Perl 5 Optimizing Compiler, Part 2
Shrug...
The gist of these ideas seems to be that the Perl5 implementors somehow got things desperately wrong, whereas the JS and/or Python implementors (who of course are doing much the same thing in much the same way) ... didn’t?
All of these systems work by JIT translation of source-code into bytecode or into an internal data-structure that is then processed using an optimized interpreter loop. Even “traditional” C++ compilers use that technique, and of course, Microsoft’s dot-Net framework is entirely based on it. The overhead of a runtime interpreter loop is frankly negligible. JIT compiling is also an affordable one-time overhead expense.
“80% of the time is spent in 20% of the code.” In many systems, those hot-spots are located in the language-common runtime libraries. In Perl et al, the hot-spots once identified can be spun off into XS subroutines. Those hot-spots will be hot-spots no matter how program-control is passed into them, and they (along with the fundamental design of the high-level program) will account for the human-visible performance impact no matter how the other 80% of the code is written.
If this were not so, then Perl, Python, Java, dot-Net, PHP and so-on would never have been done this way, and billions of lines of source-code would not have been developed using them. Before you pay to get something, be sure you’ll get what you paid for. In this case, you won’t.
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl 5 Optimizing Compiler, Part 2
by chromatic (Archbishop) on Aug 20, 2012 at 16:36 UTC | |
by bulk88 (Priest) on Aug 21, 2012 at 01:44 UTC | |
by chromatic (Archbishop) on Aug 21, 2012 at 05:39 UTC | |
|
Re^2: Perl 5 Optimizing Compiler, Part 2
by bulk88 (Priest) on Aug 21, 2012 at 01:51 UTC |