Question on compiled code when embedding Python in C++
grbgooglefan
ganeshborse at gmail.com
Mon Dec 3 23:51:01 EST 2007
On Dec 4, 12:36 pm, "Gabriel Genellina" <gagsl-... at yahoo.com.ar>
wrote:
> En Tue, 04 Dec 2007 00:54:57 -0300, Borse, Ganesh
> <ganesh.bo... at credit-suisse.com> escribió:
>
> > When we compile a Python code using functions such as Py_CompileString
> > or any other similar compile function, what will be the resulting
> > executable code?
> > Will it be byte code somewhat like the byte code of Java?
> > Or it will be the same binary code like the once generated by
> > C/C++ compilers from the source code?
>
> For CPython, the resulting bytecode consist of instructions for a virtual
> machine, like Java.
> I believe Jython compiles Python code into Java bytecode and executes
> using the Java VM.
>
> > Are these code evaluations recommended for the performance intensive
> > actions in C++ program?
>
> If you only care about speed, maybe Python isn't the right tool to use in
> the first place.
>
> There are some performance tips here:
> <http://wiki.python.org/moin/PythonSpeed/PerformanceTips> and you can use
> tools like Psyco, Pyrex and ShedSkin to improve performance dramatically.
>
> --
> Gabriel Genellina
Thanks for these tips. These are eye openers.
The link (http://wingware.com/doc/howtos/performance-profiling-python-
code) given on wiki not accessible.
Anybody who knows updating or correct link, can you please mind
correcting it on <http://wiki.python.org/moin/PythonSpeed/
PerformanceTips>?
More information about the Python-list
mailing list