[Python-ideas] Make Python code read-only
Sturla Molden
sturla.molden at gmail.com
Thu Jun 5 16:42:32 CEST 2014
On 21/05/14 02:16, Victor Stinner wrote:
> I don't want to optimize a single function, I want to optimize a whole
> application.
Right. Even Java does not do that.
(Hence the name 'Hotspot')
> If possible, I would prefer to not have to modify the application to
> run it faster.
>
> Numba plays very well with numbers and arrays, but I'm not sure that
> it is able to inline arbitrary Python function for example.
Numba will compile the Python overhead out of function calls, if that is
what you mean. Numba will also accelerate Python objects (method calls
and attribute access).
LLVM knows how to do simple optimisations like function inlining. When a
Python function is JIT compiled to LLVM bytecode by Numba, LLVM knows
what to do with ut. If the function body is small enough, LLVM will
inline it completely.
Numba is still under development, so is might no be considered
"production ready" yet. Currently it will give you performance
comparable to -O2 in C for most algorithmic Python code.
Sturla
More information about the Python-ideas
mailing list