473,769 Members | 6,473 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1544
bo**********@ya hoo.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**********@ya hoo.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**********@ya hoo.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.n et>
declaimed the following in comp.lang.pytho n:


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.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Home Page: <http://www.dm.net/~wulfraed/> <
Overflow Page: <http://wlfraed.home.ne tcom.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.n et>
DLB> declaimed the following in comp.lang.pytho n:


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.netc om.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.ne tcom.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
2652
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 touched C for large implementations, I'm seeking advice on what to use for development. My ultimate goal is to spend as less time on it as possible. I'll be writing it in Windows 32-bit environment, probably Win2000 or Win98. Planning to use a...
3
1244
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
2618
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 there (preferably freeware). TIA... - Blaine ========================================
5
2390
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 correctly. I am trying to learn C# after playing around for a bit with procedural programming with PHP, not OOP, and believe I have learned quite a bit in three weeks, just not enough to accomplish this one task. If anyone has a bit of free time and...
1
2231
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 using the DirectX playback but it is very limited and doesn't support variable speed from what I have seen. I've also read postings that say to avoid it... Any suggestions would be appreciated :) Thanks, Brett++
6
2032
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 photos at an acceptable speed. I have heard things about the virtual machine of Mr. Net, that it can run my app at a high speed....but could never compare it with Java VM and its speed. Then, what should i do? Go and learn C++ ? Do i have time for...
3
2530
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 custom text: 'www.company.com' 2. I want to reduce a little rotation speed of this text. 3. I want to fix a clock in some place, no need in mouse trail effect.
5
1701
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
1607
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 to check if Z falls within . I need to do some check only when Z is one of the mac addresses in this range. I am looking for an optimized method to do this as this check is going to be called in a high priority callback task, and
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9997
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9865
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8873
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5309
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3965
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3565
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.