473,405 Members | 2,349 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,405 software developers and data experts.

speeding up Python

Hi,

I have a 1000 line python script that takes many hours to finish. It is
running with six inside 'for' loops.

I've searched the net for ways to speed up the proccess.

Psyco improves performance around 3% in this case which is not good enough.

How can I dramatically improve speed?

I tried to find some tool that converts Python to C automatically but
couldn't. As I don't know C, I think that weave and PyInline for
example are out of the solution.

I'm using Linux.

Luis
Jul 19 '05 #1
1 1339
Luis P. Mendes wrote:
I have a 1000 line python script that takes many hours to finish. It is
running with six inside 'for' loops.


Hi Luis,

Before going too much into optimizing your current code, you might want to take
a step back and see if another approach to your problem might work instead.
Python is great for this sort of algorithmic experimentation.

So: what are you doing? In particular, why SIX nested loops?

It's not uncommon for a different algorithm to yield performance improvements
that are orders of magnitude greater than what just optimizing the code could
achieve.

-Dave
Jul 19 '05 #2

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

Similar topics

4
by: Snyke | last post by:
Hi. I have a command line script which works really fine, the only problem is that it take *really* long for the first output to be printed on screen. Since I also get some HTTP headers I'm...
4
by: Andreas Neudecker | last post by:
Hi. I have seen some discussions going on about making Python code faster and several measures looked fairly 'esoteric' to me (i.e.: you need to know a lot of background things to even KNOW...
10
by: Luis P. Mendes | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I have a 1000 line python script that takes many hours to finish. It is running with six inside 'for' loops. I've searched the net for...
12
by: dvumani | last post by:
I have C code which computes the row sums of a matrix, divide each element of each row with the row sum and then compute the column sum of the resulting matrix. Is there a way I can speed up the...
9
by: mfyahya | last post by:
Hi, I'm new to databases :) I need help speeding up select queries on my data which are currently taking 4-5 seconds. I set up a single large table of coordinates data with an index on the fields...
2
by: Robert Wilkens | last post by:
Ok... This may be the wrong forum, but it's the first place I'm trying. I'm new to C# and just implemented the 3-tier Distributed application from Chapter 1 (the first walkthrough) in the...
0
by: rbt | last post by:
Here's a quick and dirty version of winver.exe written in Python: http://filebox.vt.edu/users/rtilley/public/winver/winver.html It uses wmi to get OS information from Windows... it works well,...
4
by: jocknerd | last post by:
About 10 years ago, I wrote a C app that would read scores from football games and calculate rankings based on the outcome of the games. In fact, I still use this app. You can view my rankings at...
11
by: bullockbefriending bard | last post by:
I've done all the requisite profiling and thought fairly deeply about the efficiency of my python code, but am still going to have to speed up the innermost guts of what I am doing. Essentially,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.