embedded python: efficency query

benevilent at optusnet.com.au benevilent at optusnet.com.au
Wed Nov 10 09:13:13 CET 2004


I am embedding Python in an application, and have an efficency concern
about this. There is a Python method which is called from the main
application (written in C) many times per second (I am using the
PyObject_Call function). Unfortunately this seems to be a bottleneck, as
when the performance is compared to another language frontend of this
application, when there involves many transitions from the core
application to the language frontend, the other frontend outperforms
Python. When there are few transitions from the core application to the
language frontend (there still may be many transitions from the language
frontend to the core application) Python outperforms the other language
frontend by a healthy margin.

I will try to profile the application with both frontends to find out
more details, but I would be intereseted to know if there are any
efficency improvements that can be used to speedup the Python frontend
in the case described above.


More information about the Python-list mailing list