[plt-scheme] Statistics (V301.5 Speed Up)

From: Jim Blandy (jimb at red-bean.com)
Date: Mon Feb 13 18:16:38 EST 2006

On 2/13/06, Alexander Friedman <alex at inga.mit.edu> wrote:
> > What does the code look like?
>
> Which code in particular? The benchmarks look nice, the compiler not
> so much.

Sorry --- the generated code.  That is, you've got a
production-quality code generator there, but you're only getting what
looks like an average 100% speedup over a bytecode interpreter.  So
there's a lot of room for improvement.

It's my guess that llvm is having a hard time teasing out what's
really necessary computation from the intermediate code you're feeding
it as input.  I'd expect to see things like:
- a lack of inlining obscuring dataflow and control flow
- run-time type checks obscuring control flow
- over-generalized environment representations preventing llvm from
using registers and simplifying frame structure
- generic arithmetic preventing arithmetic optimizations (not that
anybody really knows how to fix this)

But this is all wild speculation.  If we had some generated code to
look over, we could really see what it's spending all that time on.

Please don't misunderstand what I'm writing here as criticism or a
put-down --- I'd expect even the most well-founded attempt to generate
native code to begin life in a state somewhat like this.  If I'm
remembering right, a friend of mine once produced a native code
generator for Scheme that was *slower* than the bytecode interpreter. 
I appreciate you sharing your intermediate results with us.  The
opportunity to see the process unfold is very exciting.


Posted on the users mailing list.