473,287 Members | 1,419 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,287 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 1178
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

25
by: Brian Patterson | last post by:
I have noticed in the book of words that hasattr works by calling getattr and raising an exception if no such attribute exists. If I need the value in any case, am I better off using getattr...
12
by: Fred | last post by:
Has anyone a link or any information comparing c and c++ as far as execution speed is concerned? Signal Processing algorithms would be welcome... Thanks Fred
12
by: serge | last post by:
I have an SP that is big, huge, 700-800 lines. I am not an expert but I need to figure out every possible way that I can improve the performance speed of this SP. In the next couple of weeks I...
13
by: bjarne | last post by:
Willy Denoyette wrote; > ... it > was not the intention of StrousTrup to the achieve the level of efficiency > of C when he invented C++, ... Ahmmm. It was my aim to match the performance...
1
by: jvn | last post by:
I am experiencing a particular problem with performance counters. I have created a set of classes, that uses System.Diagnostics.PerformanceCounter to increment custom performance counters (using...
1
by: shiva_seshadri | last post by:
Hi, I want to run my application(diff instances) in different geographic locations but the log info(start time and end time) to be maintained at central location. Ex: Process ...
5
by: Johnny Blonde | last post by:
Hello Group! I really tried hard for two hours to rewrite the following expression (python 2.4): -------------------------- teilnehmer = for r in Reisen.select(AND(Reisen.q.RESVON <= datum,...
13
by: atlaste | last post by:
Hi, I'm currently developing an application that uses a lot of computational power, disk access and memory caching (to be more exact: an information retrieval platform). In these kind of...
2
by: Spam Catcher | last post by:
Hi all, I'm building a multi-tier web application that is primarily driven by a web service back end. Are there any configuration settings I should know about to increase the performance of...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

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.