On Fri, Jun 6, 2014 at 12:10 AM, Sturla Molden <sturla.mol...@gmail.com> wrote:
> My experience is that only a small percentage of the CPU time is spent in
> the Python interpreter.
> [various examples ]
> - If the response time in a GUI is below the limits of human perception, can
> the user tell my Python program is slower than a C program?

And I'd go further: With several of these examples (particularly this
last one), contradictory examples are code smell at the level of the
Mythbusters' Corvette. I've had a few times when a GUI program written
in a high level language is perceptibly slow; the most recent example
was complete proof of your assertion, because under certain
circumstances it could saturate a CPU core - but generally it would be
25% in my code and 75% in Xorg. The bug was that it was redrawing a
ridiculous amount of "stuff" that hadn't changed (and in a lot of
cases wasn't even visible), in response to a sweep of user actions.
(Imagine marking and highlighting text in your favourite editor, and
every time you move the mouse a pixel across, the entire buffer gets
redrawn.) So even when response time was appalling, most of the time
was actually spent inside API calls, not my code. Given how much
easier it is to debug Python code than C code, I'd say this puts the
advantage squarely on the high level language.


Reply via email to