471,350 Members | 1,682 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

achieving performance using C/C++

I did fair amount of programming in python but never used c/c++ as
mentioned below.
any good tutorials for using C/C++ to optimize python codebase for
performance?
how widely do they use such kind of mixed coding practices?

sandip

---------- Forwarded message ----------
From: "D.Hering"
..
..
..
..
Python is very easily extended to near C speed. The Idea that FINALLY
sunk in, was that I should first program my ideas in Python WITHOUT
CONCERN FOR PERFOMANCE. Then, profile the application to find the
"bottlenecks" and extend those blocks of code to C or C++. Cython/
Pyrex/Sip are my preferences for python extension frameworks.
..
..
..
..

Nov 5 '07 #1
4 1127
Hi all,

I'd be very interseted in a good tutorial for using C/C++ to optimize
python code too !

Thanks in advance.

sandipm wrote:
I did fair amount of programming in python but never used c/c++ as
mentioned below.
any good tutorials for using C/C++ to optimize python codebase for
performance?
how widely do they use such kind of mixed coding practices?

sandip

---------- Forwarded message ----------
From: "D.Hering"
.
.
.
.
Python is very easily extended to near C speed. The Idea that FINALLY
sunk in, was that I should first program my ideas in Python WITHOUT
CONCERN FOR PERFOMANCE. Then, profile the application to find the
"bottlenecks" and extend those blocks of code to C or C++. Cython/
Pyrex/Sip are my preferences for python extension frameworks.
.
.
.
.
Nov 5 '07 #2
On Nov 5, 7:40 am, sandipm <sandip.m...@gmail.comwrote:
I did fair amount of programming in python but never used c/c++ as
mentioned below.
any good tutorials for using C/C++ to optimize python codebase for
performance?
how widely do they use such kind of mixed coding practices?
[...]

Since you are fluent in Python I also suggest you to start with
Pyrex[1]/Cython[2]. This will let you to express your ideas more
naturally (in a Python-based language) and interface with C code base
without delving much into reference counting, manual parameters
conversion and low-level exception handling.

You will find some tutorials and links to resources and mailing lists
on the projects websites, and if you specify your problem a bit more
then probably someone will be able to give you more precise
references.

For alternatives take a look at [3] and [4]. Try also scanning the
Python Package Index[5] for 'binding', 'wrapper', 'lib' or 'pyrex'
keywords or browse for C/C++ Programming Language category as this
will return some examples of Python extensions.

[1] http://www.cosc.canterbury.ac.nz/gre.../python/Pyrex/
[2] http://www.cython.org/
[3] http://www.python.org/doc/faq/extend...y-alternatives
[4] http://docs.python.org/lib/module-ctypes.html
[5] http://pypi.python.org

fw

Nov 5 '07 #3
<shameless_self_promotion>
http://artfulcode.nfshost.com/files/...ith_pyrex.html
</shameless_self_promotion>

Nov 5 '07 #4
Thanks to everybody !

Nov 6 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

25 posts views Thread by Brian Patterson | last post: by
12 posts views Thread by Fred | last post: by
13 posts views Thread by bjarne | last post: by
5 posts views Thread by Johnny Blonde | last post: by
13 posts views Thread by atlaste | last post: by
reply views Thread by XIAOLAOHU | last post: by

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.