At 01:57 PM 9/2/2001 -0400, Ken Fox wrote:
>"Bryan C. Warnock" wrote:
> > I think the only way your going to be able to detect dynamic redefinitions
> > is dynamically.  :-)
>
>Not really. Does the program include string eval? That throws out
>optimizations like folding and dead code elimination that use *any*
>global. If the program re-defines a single sub using an assignment to
>a symbol table slot, then only that sub limits optimization. The
>optimizer starts with a set of assumptions and alters those assumptions
>as it sees more of the program.

The more I think about the potential for runtime redefinition, the more I 
think having an "if optmized" op is of limited use. Certainly useful for 
the "use inlined/use non-inlined" case (to some extent) but there's a lot 
of redefinition that can really screw with some of the things that perl can 
potentially do.

We do, after all, have the possibility of having *all* our source (or all 
our bytecode, which is enough for the optimizer) at hand, something most 
other languages don't have. (Try building perl 5 as one big source file. 
You get around a 5% speedup last I knew, because the compiler could see all 
the source) That means we can sort of maybe more aggressive in our 
optimizations, since there's less entropy in the system. (Well, from the 
invisible source front, at least)

                                        Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski                          even samurai
[EMAIL PROTECTED]                         have teddy bears and even
                                      teddy bears get drunk

Reply via email to