[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pypy-dev
Subject:    Re: [pypy-dev] Preheating pypy
From:       Matt Billenstein <matt () vazor ! com>
Date:       2018-03-21 22:55:38
Message-ID: 010101624ac6626c-9fa9f3a9-71cc-4570-8181-d44c8f3e99b4-000000 () us-west-2 ! amazonses ! com
[Download RAW message or body]

Yeah, not very clean, but you could run dummy queries there that just exercised
the hot code paths.

It would be interesting to see if it worked though -- have a function that runs
much faster after jit, warm it like this, then see if behaves the same after
gunicorn forks the worker process.

m

On Wed, Mar 21, 2018 at 09:06:20AM +0100, Nagy, Attila wrote:
> On 03/18/2018 11:14 PM, Matt Billenstein wrote:
> > Seems you need to just trigger whatever heuristic causes the JIT to run on the
> > interesting codepaths during application startup.
> > 
> > Would having a small for loop in a module global namespace that called down
> > through your stack do the trick?
> > 
> > ===== somemodule.py
> > 
> > def foo(...):
> >      # maybe this function calls through several layers of code in other
> >      # modules...
> >      ...
> > 
> > for i in range(20):
> >      foo(...)  # prewarm foo...
> > 
> > =====
> > 
> > 
> That would be hard, I guess. For example I couldn't reach the processing
> layer of a connection object this way, only with real queries.

-- 
Matt Billenstein
matt@vazor.com
http://www.vazor.com/
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic