in reply to
Re^3: Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
in thread Perl 5 Optimizing Compiler, Part 4: LLVM Backend?
discounting only the amount of work needed to fully implement Perl5-to-LLVM, would you please tell me which part of BrowserUK's 3-phase idea is not producing the "I see how that might work!" epiphany in your mind?
Well, since the current perl interpreter has neither an AST, nor bytecode, I don't really understand the proposal.
But my basic issue in this case is how do you get the 5X speedup rather than the 10%? I understand in great detail exactly what C-level code the perl interpreter executes while running an ops loop (and the ops within it). No-one has yet
explained to me in a way I can understand how all the necessary stuff to carry out those actions will somehow
For example, to do a subroutine call in perl, you need to do a whole bunch of stuff like
- set up @_ and copy the stack items to it;
- set up a context stack entry so that return etc know
what to do;
- create a new scope stack level;
- bump the reference count of the live CV so that it can't be freed in mid-execution
- make the appropriate pad the current one;
All (or at least the vast majority) of this has still to be done, unless the perl interpreter is radically redesigned somehow. At the moment all this is done by a single, tuned C function. I don't see LLVM making it significantly faster.