[plt-scheme] getting better speed with JIT
At Sun, 02 Dec 2007 23:02:08 +0100, Jens Axel Soegaard wrote:
> Prabhakar Ragde skrev:
> > Jens Axel Soegaard wrote:
> >
> >> However, since it is illegal to mutate a module-required
> >> variable, the compiler can safely inline the + in:
> >>
> >> (require mzscheme)
> >> (define (foo a b) (+ a b))
> >
> > Thanks. This is pretty much what the text in the mzc compiler manual
> > says (even though that's a different beast from the JIT, no?).
>
> Different beast. Same problem.
Section 1.4 of the current mzc manual is about both JIT and mzc
compilation.
That organization makes little sense, of course, and we're fixing it as
part of the v4 doc overhaul.
> > I think this should be more widely advertised.
>
> I vaguely recall a discussion on whether or not it were
> a good idea to change the default. Since mutation of the
> standard bindings rarely are needed, it makes sense
> to have the restrictive semantics as the default.
>
> The spirit of such a change is in my view similar to
> making cons produce immutable pairs.
The default is effectively changed in v3.99.
The "MzScheme" and "MrEd" languages in DrScheme v3.99 work as before,
but they're now filed under "Legacy".
I must say, though, that code serious enough to benchmark belongs in a
module. The point of the module system is to organize the language so
that you don't have to learn hacks like a `(require mzscheme)' prefix
to get the best performance we can offer. Also, the module system
enables inlining and constant-folding/-propagation optimizations that
don't work across top-level definitions, even with `(require
mzscheme)'.
Matthew