What can Nuitka do?

Steven D'Aprano steve+comp.lang.python at pearwood.info
Fri Jun 27 23:09:11 EDT 2014


On Fri, 27 Jun 2014 19:10:25 -0700, Rustom Mody wrote:

> If no one speaks up (with hard specific data!) for the technologies you
> are considering (eg PyPy, Nuitka etc) then I would conclude that they
> are not yet ready for prime-time/ your use-case

A silly conclusion. The OP's use-case is quite specific, namely he wants 
to freeze a wxPython GUI app in a single executable *and* optimize it, 
while this mailing list is very general. Most people here are not experts 
on *any* of Nuitka, PyPy, wxPython or freezing applications, let alone 
all of them. Lack of hard specific evidence is not evidence that the job 
cannot be done, it's just evidence that the people here don't know how.

Having said that, I think that the OP's question is probably misguided. 
He or she gives the impression of expecting PyPy or Nuitka to be a magic 
button that will speed up the user experience, like the Turbo button on 
old PCs. (Remember them?) It's not likely to be that easy.

wxPython is a wrapper to a C GUI library, all the work is done in C, not 
Python, so moving to PyPy or Nuitka won't speed it up. It may even slow 
it down, if the interpreter is less efficient at calling C libraries.

Additionally, in most GUI apps (although not all), the main bottleneck is 
usually not the programming language but the user. GUI apps tend to spend 
95% of their time idling, waiting for the user. Its been a *long* time 
since the GUI framework itself has lagged behind the user's input, except 
in cases of memory exhaustion. So if the OP is interested in speeding up 
his or her application, the first thing to do is to identify what parts 
of it are slow, identify why they're slow, and concentrate on those parts.

For example, if the OP's app is slow because it repeatedly scans a remote 
network directory, then moving to PyPy won't speed it up, because file 
operations over a network are inherently slow. If it's slow because it 
foolishly uses bubble sort to sort 1000 items instead of Python's built-
in sort, then moving to PyPy may technically speed it up, but probably 
not enough to notice.

Some problems are inherently slow. Some are fixable by using better 
algorithms. And some are fixable by using an optimizing compiler like 
PyPu or Nuitka. We are given no reason to think that the OP's problems 
lie in that third area rather than the first two.


-- 
Steven



More information about the Python-list mailing list