473,394 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

embedded python: efficency query

Hey,

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.

Thanks,
Laurie
Jul 18 '05 #1
1 1327
Hi,

PyObject_CallFunction will parse the arguments and create a tuple from it,
which then calls PyObject_Call. You can try creating this tuple ahead of
time to avoid allocating it for every call. This might help a little.

-Farshid

<be********@optusnet.com.au> wrote in message
news:ma**************************************@pyth on.org...
Hey,

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.

Thanks,
Laurie

Jul 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: ulysses | last post by:
Hi,all I use wxPython make a bittorrent client. I find wxPython very slow and use many many memory. When app start, it need 19MB memory. I only use common GUI components. Python is a really...
13
by: Alexander May | last post by:
Hi, I love Python! I've been using it for a couple of years now and have found it to be a highly productive language. I evangelize it to my developer friends and am probably responsible for...
0
by: newbie | last post by:
Hi all, I got a problem using the embedded python. I'll be appreciated if some one can show me the way. What i want is, 1.build a dll(test.dll/test.lib) which uses the embedded python, for...
3
by: Godzilla | last post by:
Has anyone install Python on Windows XP Embedded? We wish to evaluate the possible solution of installing Python with WinXPE on a PC/104 plus module. Thank you.
22
by: Glurt Wuntal | last post by:
I am a newbie with Python. It's a great language, but I would like to be able to present a simple gui menu for some of my scripts; something better than using 'raw_input' prompts. Any...
20
by: Jack | last post by:
Is there a Python packaging that is specifically for embedded systems? ie, very small and configurable so the user gets to select what modules to install? For Linux-based embedded systems in...
2
bugboy
by: bugboy | last post by:
Does the total number of rows in a table determine the amount of resources required for a query?.. or is it primarily determined by the number of rows used by the query? ..Does an INDEX mean it...
0
bugboy
by: bugboy | last post by:
I'm experimenting with the "Nested Set" type structure for holding hierarchical data in mysql. This is my refrence: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html When i...
3
by: Daniel Fetchinson | last post by:
Does Python 2.5.2's embedded SQLite support full text searching? Sqlite itself is not distributed with python. Only a python db api compliant wrapper is part of the python stdlib and as such it...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.