On Sun, 28 Jan 2018, Etienne Robillard wrote:

Is it possible to use the PyPy JIT compiler embedded into a CPython (Django) application?

I would like to translate a Django app into C code then compile the binary with clang to optimize the code with a JIT engine.

What do you think?

I think that you might be confused about the fundamentals of the technologies involved here.

Once you translate a Django app into C code (let's assume this is actually possible for the sake of the argument) and then compile it into machine code using clang there is nothing more left for a JIT to operate upon, because machine code is interpreted directly by the CPU.

Tracing JIT engines like PyPy translate bytecode into machine code on the fly taking into account invariants discovered during runtime, which theoretically enables them to outperform machine code generated without knowing the data it processes, and, in any case, run a lot faster than the interpreted byte code.

A possible source of confusion is that people often speak of speeding things up with LLVM (or nowadays even GCC) JIT; in most cases this amounts to so called method level JITs where specific isolated functions are compiled on the fly into machine code by the corresponding JIT backend and then called from the bytecode interpreter instead of actually interpreting the original bytecode for the method.

Anyways, having that said, I can't even infer what your original line of thinking was to embed what into what to speed up what exactly...

--
Sincerely yours,
Yury V. Zaytsev
_______________________________________________
pypy-dev mailing list
pypy-dev@python.org
https://mail.python.org/mailman/listinfo/pypy-dev

Reply via email to