Re: [Tutor] Performance Issue

2018-10-18 Thread User2002
Thanks to all for your indulgence and help… From: Alan Gauld Sent: Thursday, October 18, 2018 6:53 AM To: User2002 Cc: tutor@python.org Subject: RE: [Tutor] Performance Issue Cc'ing list. Please use reply all on responses to tutor. If you have no control over the server, eh a

Re: [Tutor] Performance Issue

2018-10-18 Thread Alan Gauld via Tutor
it reaches 7:00:00. So I am not sure there are improvements to be made in that area. -Original Message- From: Tutor On Behalf Of Alan Gauld via Tutor Sent: Wednesday, October 17, 2018 8:12 PM To: tutor@python.org Subject: Re: [Tutor] Performa

Re: [Tutor] Performance Issue

2018-10-17 Thread Alan Gauld via Tutor
On 17/10/18 22:25, Stephen Smith wrote: > I have written a screen scraping program that watches a clock (on the app's > server) and at 7:00:00 AM dashes to make a reservation on line. It works > fine. However, i have spent time trying to improve its performance. I am > using selenium, with chrome d

[Tutor] Performance Issue

2018-10-17 Thread Stephen Smith
I have written a screen scraping program that watches a clock (on the app's server) and at 7:00:00 AM dashes to make a reservation on line. It works fine. However, i have spent time trying to improve its performance. I am using selenium, with chrome driver. Here is what i have learned. I have tri

Re: [Tutor] Performance measurement tools

2011-10-18 Thread Hugo Arts
On Tue, Oct 18, 2011 at 10:49 AM, Ashish Gaonker wrote: > Hi > Can you suggest the best performance measurent tools for python programs. > specifically thread based python modules. > -- > Thanks & Regards > Ashish Gaonker I've heard very good things about yappi: http://code.google.com/p/yappi/ _

[Tutor] Performance measurement tools

2011-10-18 Thread Ashish Gaonker
Hi Can you suggest the best performance measurent tools for python programs. specifically thread based python modules. -- Thanks & Regards Ashish Gaonker ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail

Re: [Tutor] Performance list vs. deque for [-1]

2010-08-12 Thread Sander Sweers
On 12 August 2010 12:07, Sander Sweers wrote: > Deque took 0.009195 seconds > 693.01178383827209 / 10 (default times run by timeit) Messed up the deque results :( Deque took 0.009195 seconds 919.49732708930969 / 10 (default times run by timeit) Greets Sander

Re: [Tutor] Performance list vs. deque for [-1]

2010-08-12 Thread Dave Angel
Knacktus wrote: Hi everyone, I'm wondering what's the fastet datatype in python to lookup the last element in an ordered collection. I know about lists, of course, and read about deques. As I understand deques have better performance for popping and adding elements, but I didn't understand wh

Re: [Tutor] Performance list vs. deque for [-1]

2010-08-12 Thread Sander Sweers
On 12 August 2010 09:44, Alan Gauld wrote: >> I'm wondering what's the fastet datatype in python to lookup the last >> element in an ordered collection. > > When in doubt timeit() Out of curiosity I used timeit and lists are faster if we iterate over them one by one. Now this is my first go with

Re: [Tutor] Performance list vs. deque for [-1]

2010-08-12 Thread Alan Gauld
"Knacktus" wrote I'm wondering what's the fastet datatype in python to lookup the last element in an ordered collection. When in doubt timeit() But I would expect a standard list to be prettyy fast isf you are only concerned about accessing the last element [-1] Also, the collections will

[Tutor] Performance list vs. deque for [-1]

2010-08-11 Thread Knacktus
Hi everyone, I'm wondering what's the fastet datatype in python to lookup the last element in an ordered collection. I know about lists, of course, and read about deques. As I understand deques have better performance for popping and adding elements, but I didn't understand what's the behavior

Re: [Tutor] performance loss -- profiling

2009-05-19 Thread Tim Golden
Kent Johnson wrote: The Python profiler is not hard to run. Interpreting the results is more difficult :-) See the docs to get started: http://docs.python.org/library/profile.html Also, it's quite useful to run it as a module: python -mcProfile You have a certain amount of configurability v

Re: [Tutor] performance loss -- profiling

2009-05-19 Thread Kent Johnson
On Mon, May 18, 2009 at 2:49 PM, spir wrote: > Hello, > > I have an big performance problem with an app I'm currently working on. > It "suddenly" runs at least 5 times slower that it used to. The issue is, > beeing in a finalization phase, I'm all the time touching thingies here and > there. But

Re: [Tutor] performance loss -- profiling

2009-05-19 Thread spir
Le Mon, 18 May 2009 23:16:13 +0100, "Alan Gauld" s'exprima ainsi: > "spir" wrote > > > Also, it's the first time I really have to cope with machine-time; > > so I'm totally new to technics like using a profiler. > > Any hints on the topics heartfully welcome :-) > > Profilers are a bit like

Re: [Tutor] performance loss -- profiling

2009-05-18 Thread Alan Gauld
"spir" wrote Also, it's the first time I really have to cope with machine-time; so I'm totally new to technics like using a profiler. Any hints on the topics heartfully welcome :-) Profilers are a bit like debuggers. Very useful when needed but usually a point of last resort. First, what

[Tutor] performance loss -- profiling

2009-05-18 Thread spir
Hello, I have an big performance problem with an app I'm currently working on. It "suddenly" runs at least 5 times slower that it used to. The issue is, beeing in a finalization phase, I'm all the time touching thingies here and there. But performance change is visible only when running on big t

Re: [Tutor] performance

2007-09-17 Thread Ricardo Aráoz
Carlos Daniel Ruvalcaba Valenzuela wrote: > Don't worry too much for the accessors, I'm pretty sure it won't > degrade your performance in a noticeable way, you objects will only > grow a tiny bit by adding a function to the class, all objects share > the same in memory code and each one has it's o

Re: [Tutor] performance

2007-09-17 Thread Alan Gauld
"Jeff Peery" <[EMAIL PROTECTED]> wrote > I am taking measurements and building up a list of objects > for each measurement. the class I created for the objects has > attributes > I also have functions within my class (I think they are properly > named 'accessors'?) that get a piece of data within

Re: [Tutor] performance

2007-09-16 Thread Carlos Daniel Ruvalcaba Valenzuela
Don't worry too much for the accessors, I'm pretty sure it won't degrade your performance in a noticeable way, you objects will only grow a tiny bit by adding a function to the class, all objects share the same in memory code and each one has it's own data, the function for the object is just a ref

[Tutor] performance

2007-09-16 Thread Jeff Peery
Hello, I've got a quick question regarding performance of lists. I am taking measurements and building up a list of objects for each measurement. the class I created for the objects has attributes of time, numerical value, person's name who collected the sample etc. I also have functions with

Re: [Tutor] Performance of classes

2006-06-18 Thread Ismael Garrido
Kent Johnson wrote: > Ismael Garrido wrote: > >> I have attached the code, I hope that's fine. If you have any further >> optimization suggestions I would be very glad to hear them :) >> > > generarResist() is doing a lot more work than necessary. Because i and j > both iterate the entire

Re: [Tutor] Performance of classes

2006-06-18 Thread Kent Johnson
Ismael Garrido wrote: > Hello > > I'm writing a program to find an appropiate combination of resistances > to obtain a desired value of resistance. The program takes into account > how many resistances you have available and their resistance in ohms. > > Since this problem (as far as I can tell

[Tutor] Performance of classes

2006-06-17 Thread Ismael Garrido
Hello I'm writing a program to find an appropiate combination of resistances to obtain a desired value of resistance. The program takes into account how many resistances you have available and their resistance in ohms. A short review of physics: resistors can be arranged in series or in para

Re: [Tutor] Performance of Python loops vs multiple MySQL queries

2005-12-22 Thread Alan Gauld
> Also there was a consideration of performance. I have one question on > the topic breaking code into small functions and performance. I have > read somewhere that *any* call whatoever, that is, methods, functions > and such, involve a performance cost. Is that right? Yes it is, but its not a hug

Re: [Tutor] Performance of Python loops vs multiple MySQL queries

2005-12-22 Thread Bernard Lebel
Thanks for all the advice Kent. Bernard On 12/22/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Bernard Lebel wrote: > > On 12/21/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > >>- Don't assume there is going to be a problem. > > > > > > [Bernard] Okay perhaps by "problem" I have not been very a

Re: [Tutor] Performance of Python loops vs multiple MySQL queries

2005-12-22 Thread Kent Johnson
Bernard Lebel wrote: > On 12/21/05, Kent Johnson <[EMAIL PROTECTED]> wrote: >>- Don't assume there is going to be a problem. > > > [Bernard] Okay perhaps by "problem" I have not been very accurate. I > meant "sync" problems. You see, when the script finds a job, it makes > updates in the database

Re: [Tutor] Performance of Python loops vs multiple MySQL queries

2005-12-22 Thread Bernard Lebel
On 12/21/05, Kent Johnson <[EMAIL PROTECTED]> wrote: > Bernard Lebel wrote: > > Hello, > > > > Finally, after a year and a half of learning and messing around with > > Python, I'm writing THE code that made learn Python in the first > > place: a render farm client management software. I may have se

Re: [Tutor] Performance of Python loops vs multiple MySQL queries

2005-12-21 Thread Kent Johnson
Bernard Lebel wrote: > Hello, > > Finally, after a year and a half of learning and messing around with > Python, I'm writing THE code that made learn Python in the first > place: a render farm client management software. I may have several > questions regarding this, but for now I only have one.

[Tutor] Performance of Python loops vs multiple MySQL queries

2005-12-21 Thread Bernard Lebel
Hello, Finally, after a year and a half of learning and messing around with Python, I'm writing THE code that made learn Python in the first place: a render farm client management software. I may have several questions regarding this, but for now I only have one. The script I'm writing is the cli

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-18 Thread Bill Campbell
On Sun, Jul 17, 2005, Danny Yoo wrote: >> A related question is where's the trade-off between using ``in'' with a >> list, and a dictionary? I presume that using it with small hashes will >> be faster than dictionries since it doesn't have to calculate the >> hashes. > >Hi Bill, > >Scanning for an

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread Danny Yoo
> A related question is where's the trade-off between using ``in'' with a > list, and a dictionary? I presume that using it with small hashes will > be faster than dictionries since it doesn't have to calculate the > hashes. Hi Bill, Scanning for an elements in a list is a "linear" operation, in

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread Kent Johnson
Bill Campbell wrote: > I'm going to be doing some work where I'll be doing existence > testings on keys on about a million records where it may require > multiple passes so I'm a bit concerned about the timing of these > tests. > > Is there any significant performance difference between the > test

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread Andreas Kostyrka
A short trial with timeit.py shows that k in d is faster than d.has_key(k) k in d is about as fast as hk(d), where hk = d.has_key So it seems both expressions are about the same, but the expression dict.has_key involves an additional dictionary lookup to fetch has_key. Andreas Am Sonntag, den

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread Andreas Kostyrka
Am Montag, den 18.07.2005, 00:53 +0200 schrieb Max Noel: > On Jul 17, 2005, at 20:18, Bill Campbell wrote: > > > Is there any significant performance difference between the > > tests, ``key in dictionary'' and ``dictionary.has_key(key)''? > > I would prefer using the ``key in'' because it's a bit

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread André Roberge
Max Noel wrote: > [snip] > > > While we're on that topic, is there a particular reason why 'in', > in a dict context, searches the keys instead of doing the logical thing > and searching the values? animals = { 'cat': "a cuddly little mammal who likes to eat birds", 'dog': "man's best fr

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread Max Noel
On Jul 17, 2005, at 20:18, Bill Campbell wrote: Is there any significant performance difference between the tests, ``key in dictionary'' and ``dictionary.has_key(key)''? I would prefer using the ``key in'' because it's a bit easier to type, and can also be used with lists in addition to diction

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread jfouhy
Quoting Bill Campbell <[EMAIL PROTECTED]>: > I'm going to be doing some work where I'll be doing existence > testings on keys on about a million records where it may require > multiple passes so I'm a bit concerned about the timing of these > tests. If you're just doing existence testing, is it a

Re: [Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread R. Alan Monroe
> Is there any significant performance difference between the > tests, ``key in dictionary'' and ``dictionary.has_key(key)''? > I would prefer using the ``key in'' because it's a bit easier to > type, and can also be used with lists in addition to dictionaries. Dunno about speed, but they do disas

[Tutor] Performance difference, ``in'' vs ``has_key()''

2005-07-17 Thread Bill Campbell
I'm going to be doing some work where I'll be doing existence testings on keys on about a million records where it may require multiple passes so I'm a bit concerned about the timing of these tests. Is there any significant performance difference between the tests, ``key in dictionary'' and ``dict