[pypy-dev] Saving and reloading JIT optimizations
David Fraser
davidf at sjsoft.com
Fri Aug 19 15:48:46 CEST 2011
On Friday, August 19, 2011 at 3:32:07 PM, "Armin Rigo" <arigo at tunes.org> wrote:
> Hi David,
>
> On Fri, Aug 19, 2011 at 1:56 PM, David Fraser <davidf at sjsoft.com>
> wrote:
> > The pypy JIT takes a while to work out which parts of python code
> > need optimization etc, and only after that phase do the speedups
> > become relevant. Have there been any efforts (indeed, is it a
> > feasible idea at all) that look at saving these optimizations for
> > future runs of the same codebase?
>
> No, this is not really doable. The JIT writes explicitly in the
> assembler the address of a ton of constants. We have no clue what
> these constants become when we are in a different process. Think even
> just about Python classes: there is no way at all to know that a class
> at address 0x1234567 is "the same" as a previous class in a previous
> process at address 0x7654321, let alone defining what exactly "the
> same" means.
OK, thanks for the explanation
> Instead, we can work on lowering the warm-up time of the JIT, notably
> by lowering the (so far very large) overhead it takes for the JIT to
> trace a loop.
That makes a lot of sense.
Also in my web-server case, I guess I could work around the current situation by deliberately doing a bunch of requests after startup that will prime the JIT
Cheers
David
More information about the pypy-dev
mailing list