Wow, this got my attention. I use Python for web application development. A 2-3x speedup would be very interesting for higher-load deployments.
The best feature of nuitka, and its main goal, is not speed gain. That's the cherry on top. The main goal is getting a standalone executable that works with c extensions.
Nuitka: An extremely compatible Python compiler
31–40 of 88 posts
Re: Nuitka: An extremely compatible Python compiler
#32Wow, this got my attention. I use Python for web application development. A 2-3x speedup would be very interesting for higher-load deployments.
Re: Nuitka: An extremely compatible Python compiler
#33Earlier quoted context omitted.
That's an interpreter written in C and without a JIT. Not the same as an AOT compiler. https://github.com/bellard/quickjs/blob/master/quickjs-opcod... The point isn't just not having a JIT. You can run v8 without a JIT. The point is good performance without a JIT.
"Can compile Javascript sources to executables with no external dependency"
> Only output bytecode in a C file. The default is to output an executable file.
> @item -e
> Output @code{main()} and bytecode in a C file. The default is to output an executable file.
https://github.com/bellard/quickjs/blob/master/doc/quickjs.t...
Re: Nuitka: An extremely compatible Python compiler
#34Earlier quoted context omitted.
That's an interpreter written in C and without a JIT. Not the same as an AOT compiler. https://github.com/bellard/quickjs/blob/master/quickjs-opcod... The point isn't just not having a JIT. You can run v8 without a JIT. The point is good performance without a JIT.
"Can compile Javascript sources to executables with no external dependency"
Re: Nuitka: An extremely compatible Python compiler
#35Wow, this got my attention. I use Python for web application development. A 2-3x speedup would be very interesting for higher-load deployments.
What sort of web applications do you work on where Python interpreter speed is the limiting factor? Usually, those applications are constrained by network throughput and context switches and page faults.
At my company, for a web app we run in production, we strive to get every response out of our infrastructure in under a millisecond, everything above that except for a few select endpoints is considered as a bug. By using sensible technology choices, it's not even that hard to do. A RDMS like postgres can answer to queries in microseconds.
Nice bonus, we can provide real time computation features our competitors could only dream of, just by not using dog-slow technology.
Our customers are not techies and you know what? When they use our product, the first comment is usually "wow, it's so fast".
Re: Nuitka: An extremely compatible Python compiler
#36For example, the homepage of Nuitka says they only just added support for constant folding and propagation. That's such low hanging fruit it's crazy they have to do that for themselves.
You can imagine generic libraries for Python/JavaScript/Ruby that will turn the AST alone into its most optimal form and then let some other backend worry about code generation or VM implementation.
Re: Nuitka: An extremely compatible Python compiler
#37Wow, this got my attention. I use Python for web application development. A 2-3x speedup would be very interesting for higher-load deployments.
if you're just looking to speed things up PyPy, and Cython are both good options
Re: Nuitka: An extremely compatible Python compiler
#38Earlier quoted context omitted.
if you're just looking to speed things up PyPy, and Cython are both good options
Graal Python is really fast too, but I'm not sure how it plays with C extensions.
Re: Nuitka: An extremely compatible Python compiler
#39How is this more compatible than just python? Since it requires libpython so you anyway need to have python installed on the target machine? Also is this actually faster than just python? I tried it out with some bad expensive looping using lists with python3.9 and it was 100ms slower (1.3sec vs 1.4sec). Just in general why should I be using Nuitka?
> Also is this actually faster than just python? I tried it out with some bad expensive looping using lists with python3.9 and it was 100ms slower (1.3sec vs 1.4sec). Mind sharing that code? I'm sure someone would like to be able to look into this.
python -m nuitka --clang --follow-imports main.py
repo: https://github.com/MRCIEU/gwas2vcf
If someone can make the program run faster by whatever means, it will make a bunch of people quite happy.
Re: Nuitka: An extremely compatible Python compiler
#40Earlier quoted context omitted.
What sort of web applications do you work on where Python interpreter speed is the limiting factor? Usually, those applications are constrained by network throughput and context switches and page faults.
This argument is so tiring. That's part of why websites are so slow despite having insane hardware at their disposal. At my company, for a web app we run in production, we strive to get every response out of our infrastructure in under a millisecond, everything above that except for a few select endpoints is considered as a bug. By using sensible technology choices, it's not even that hard to do. A RDMS like postgres…
Just to expand on your point:
Sure you can let a chunk of code take a few seconds longer than it could with little overall effect.
But stack a hundred of these up and all those seconds compound and suddenly become immensely important.
A suit of armour with a million chinks isn't very effective armour.
(As an aside, depending on your use case, it can be worth optimizing the big bottlenecks, high use, computationally expensive, etc. components and not worry too much about the rest)