GUI:-please answer want to learn GUI programming in python , how should i proceed.

Chris Angelico rosuav at gmail.com
Sun Dec 15 23:57:58 EST 2013


On Mon, Dec 16, 2013 at 3:09 PM, Tamer Higazi <tameritoke2 at arcor.de> wrote:
> I also believe in performance. An application written in C++, can be
> compiled easily on the target platform (like on windows systems) with it's
> native compiler.
> How would it be with wxPython ?!

It's going to spend more than 99% of its time waiting for the user.
Most applications aren't performance-bound. Over the past few years, I
can think of *one* case when my GUI program was actually saturating a
CPU core and I had to dig into a performance fault; the simplistic
design had meant that it would iterate over an entire list of strings
to find which ones it needed to draw, and once that list got huge, the
redraw operation started taking time. But there was no visible problem
except when the app was redrawing itself many times a second in
response to user action AND the set of strings got, as I said, huge.
Every other part of that program, and all of every other GUI
interactive program I've written in recent years, has been coded for
simplicity and not for performance. (This particular example is
actually quite pertinent, as it's the "designated replacement" for a
very similar program written in C++. The C++ one has a tendency to
crash hard if user code does the wrong thing, as there is absolutely
no protection anywhere, while the new code will, at very worst, spew a
traceback and then go back to processing events.)

Of course, performance is a relative thing. If you're running on a PC,
there's no difference at all between taking 1ms and taking 2ms - no
human will notice. But if you're running on a server, that's the
difference between 1000tps and 500tps. And on a phone, that CPU usage
might have an impact on battery life, and running on a tiny PCB the
same coding difference might be the difference between 400ms and
800ms. But in the day-to-day realm of desktop apps, maintainable code
will always be better than marginally faster code.

ChrisA



More information about the Python-list mailing list