Re: [pypy-dev] Preheating pypy

2018-03-21 Thread Matt Billenstein
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

Re: [pypy-dev] Preheating pypy

2018-03-21 Thread Nagy, Attila
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? = som

Re: [pypy-dev] Preheating pypy

2018-03-18 Thread Matt Billenstein
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 functio

[pypy-dev] Preheating pypy

2018-03-18 Thread Nagy, Attila
Hi, I use pypy to run an application in gunicorn. Gunicorn (as well) has a "preload" capability in multiprocess workers, which means it loads the application in one interpreter/process and instead of starting new interpreters/processes for additional workers, it just forks from the first one.