473,396 Members | 1,921 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,396 software developers and data experts.

need for speed

hi everyone
can someone suggest me where find a lot programming tricks for
achieving the top speed in python?
thanks everyone for patience

Aug 1 '05 #1
7 1529
bo**********@yahoo.it wrote:
hi everyone
can someone suggest me where find a lot programming tricks for
achieving the top speed in python?
thanks everyone for patience


Check this out:
http://wiki.python.org/moin/PythonSpeed/PerformanceTips

Aug 1 '05 #2
On Mon, 01 Aug 2005 02:28:36 -0700, bo**********@yahoo.it wrote:
hi everyone
can someone suggest me where find a lot programming tricks for
achieving the top speed in python?


There is only one programming trick you need to know about making code run
fast.

Never even waste one second on optimising code before it is working,
or before you have tested it and profiled it and know (1) that it IS slow;
and (2) WHERE it is slow.

Why would you waste your valuable time making bugs run faster? Why waste
time and effort to speed up something that is already fast enough?

In other words: Make your code work. Make it work right. Then, and only
then, make it run fast -- and only if it isn't already fast.

Now that you have written your code, and you have made it work right,
please tell us what the code is, and the results of profiling the code,
and we will help you speed it up.

--
Steven
Aug 1 '05 #3
SDA> On Mon, 01 Aug 2005 02:28:36 -0700, bo**********@yahoo.it wrote:
hi everyone
can someone suggest me where find a lot programming tricks for
achieving the top speed in python?


SDA> There is only one programming trick you need to know about making code run
SDA> fast.

SDA> Never even waste one second on optimising code before it is working,
SDA> or before you have tested it and profiled it and know (1) that it IS slow;
SDA> and (2) WHERE it is slow.

SDA> Why would you waste your valuable time making bugs run faster? Why waste
SDA> time and effort to speed up something that is already fast enough?

SDA> In other words: Make your code work. Make it work right. Then, and only
SDA> then, make it run fast -- and only if it isn't already fast.

SDA> Now that you have written your code, and you have made it work right,
SDA> please tell us what the code is, and the results of profiling the code,
SDA> and we will help you speed it up.
Is there a way of profiling other than manual (debug output with
measurements and all)? Some tools? And is there some kind of plugin
for native Python's IDLE to trace scripts? I'm a bit tired of getting
all info from debug output and exceptions

SDA> --
SDA> Steven

--
Best Regards,
Michael Rybak mailto:ac******@ukr.net

Aug 1 '05 #4
Michael Rybak a écrit :
(snip)

Is there a way of profiling other than manual (debug output with
measurements and all)? Some tools?


http://docs.python.org/lib/profile.html

HTH
Aug 1 '05 #5
On Mon, 1 Aug 2005 20:14:51 +0300, Michael Rybak <ac******@ukr.net>
declaimed the following in comp.lang.python:


Is there a way of profiling other than manual (debug output with
Chapter 10 of the Python Library Reference... You have looked at
that document, haven't you?
measurements and all)? Some tools? And is there some kind of plugin
for native Python's IDLE to trace scripts? I'm a bit tired of getting
Have you read Chapter 9?

BTW: if you are working on M$ Windows, you might want to
consider installing the ActiveState release -- PythonWin might be nicer
than IDLE (and has the referenced manuals formatted as Windows help
files).

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.netcom.com/> <

Aug 2 '05 #6
sorry for emailing privately, pressed the wrong "reply" button

DLB> On Mon, 1 Aug 2005 20:14:51 +0300, Michael Rybak <ac******@ukr.net>
DLB> declaimed the following in comp.lang.python:


Is there a way of profiling other than manual (debug output with
DLB> Chapter 10 of the Python Library Reference... You have looked at
DLB> that document, haven't you?
Already am, yes!
measurements and all)? Some tools? And is there some kind of plugin
for native Python's IDLE to trace scripts? I'm a bit tired of getting


DLB> Have you read Chapter 9?
ok, I'm looking through. A bit tough for me I think, I can live with
debug outputs :) Well I'm too much used to M$ V$ / Borland Delphi
interfaces to switch to almost-asm-like debugging.

DLB> BTW: if you are working on M$ Windows,
only on that
DLB> you might want to consider installing the ActiveState release
I tried, and the installer gives me that stupid Internal Error 2229:
Control, SELECT 'Control', 'Type', 'X', 'Y', [..snip..], 'Dialog' = ?
And I forgot the OK button.

DLB> -- PythonWin might be nicer than IDLE (and has the referenced
DLB> manuals formatted as Windows help files).
I am using a *.chm file containing all online documentation available
from python.org

DLB> --
DLB> > ================================================== ============ <
DLB> > wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
DLB> > wu******@dm.net | Bestiaria Support Staff <
DLB> > ================================================== ============ <
DLB> > Home Page: <http://www.dm.net/~wulfraed/> <
DLB> > Overflow Page: <http://wlfraed.home.netcom.com/> <

--
Best Regards,
Michael Rybak mailto:ac******@ukr.net

Aug 2 '05 #7
sorry for emailing privately, pressed the wrong "reply" button

BD> Michael Rybak a écrit :
BD> (snip)

Is there a way of profiling other than manual (debug output with
measurements and all)? Some tools?


BD> http://docs.python.org/lib/profile.html

BD> HTH

Ohhhhh, wow! Manuals rule, I should have at least skimmed through.
Thanks a lot, already profiling :)

--
Best Regards,
Michael Rybak mailto:ac******@ukr.net

Aug 2 '05 #8

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

Similar topics

10
by: Beach Potato | last post by:
Dear Y'all: I'm about to start porting a big old project written in anscient version of Delphi to something more stable, robust, supportable and maybe even portable. Since I haven't seriously...
3
by: Patric | last post by:
Hi I'm having some problem getting the following result. I have 2 tables Drivers -------- DriverID int (PK) DriverName varchar(50)
4
by: Beeman | last post by:
I am looking for a good control that would display/print JPEG images in Access 97. The existing Image controls, even with the JPEG filters, are very slow - and I know there are better ones out...
5
by: MFC | last post by:
Ok, after three C# books, (C# How to Program, Programming in the Key of C#, and C# Weekend Crash Course) and three weeks, I believe I have tried everything to make a certain form function...
1
by: Brett Hofer | last post by:
Does anyone know of a good component for audio(.WAV) playback that supports double-speed/normal/half-speed? I need to provide this control in an .aspx page and control it using C#. I have tried...
6
by: Ham | last post by:
Yeah, Gotto work with my VB.Net graphic application for days, do any possible type of code optimization, check for unhandled errors and finally come up with sth that can't process 2D graphics and...
3
by: mistral | last post by:
Here is javscript clock: http://javascript.internet.com/time-date/mousetrailclock.html which I want adjust a little: 1. I want replace the days of week/year/date in external circle with just...
5
by: ra7l | last post by:
Hi All .. First Thanks to All For Help Me .. ok ..This Code it Move Train but one errore small.. Where Correct Cods Thanks All .. :)
11
by: lakshmiram.saikia | last post by:
Hi, I need to do the following operation : '" I have two mac addresses, say X and Y,where X is the base mac address, and Y is the nth mac address from X, each incremented by one. Now,I want...
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: 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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.