I was trying some Python APIs maded for some C++ calls and I see no decrease in performance. Actually, I think that the equivalent application written only in C++ is a little bit slower/laggish.
In particular, I was trying Pyside and some QT application in C++.
Now I know that GUIs love languages that have a good support for dynamic bindings, but I don’t know too much about Python internals: is there some explanation for the reason why a Pyside application is at least as fast as the C++ equivalent ?
If I offer Python APIs inside my C++ program, what will the costs be? One more indirection?
P.S.
Does python offer some native Windowing framework for cross-platform development?
At the risk of being downvoted, I’m going to provide a very crude, somewhat subjective hypothesis.
QT, while being very general-purpose, doesn’t exactly provide a blazing fast GUI API. Its level of abstraction has quite a cost. We’re talking about a heap allocation per widget, per layout, etc. Just have a look at QListWidget and the fact that QListWidgetItem in itself is a separately allocated, fairly complex object. I once had to profile a developer’s code — the logic was suspected to be slow, but I found that almost the entire 6 seconds it took for the operation was spent creating a QListWidget with thousands of list entries. This was in C++.
My thoughts on this, without seeing your code and usage of QT, is that the overall overhead of the QT GUI makes the differences between a language like C++ and Python negligible.
Now what isn’t so debatable is that the productivity of using QT through Python is dramatically greater than using it in C++ where we have to deal with the MOC with preprocessed signals and slots, etc. You might want to focus on that more than the performance differences of using a GUI framework in one language vs another.
http://wiki.python.org/moin/GuiProgramming