Dick Moores wrote:
At 10:22 AM 8/24/2007, Kent Johnson wrote:
So you actually pasted that code into timeit.py?Yeah. :-( I think I learned on the Tutor list to do it that way, but I'm not sure. Thanks for showing me a correct way.
I hope not!
Using timeit more conventionally I get unsurprising results. This program has output:Using your exact code, I just got
0.497083902359
0.359513998032
which is more in line with what I would expect.
0.737564690484
1.17399585702
Which is the reverse of your result, but on a slower computer. What's up with that??
I have no idea. Some strange interaction with the memory cache? I'm running Python 2.5.1 on a MacBook Pro (Intel Core 2 Duo processor). How about you?
Python 2.5; Dell Dimension 4600i; 2.80 gigahertz Intel Pentium 4. The other day my computer guy put in a 512K stick of memory, making the total 1024K. However, by doing so he shut off the dual channel memory. I understand now that he should have put in a pair of 256k sticks to go with the pair that were already there. Seems far-fetched, but could this be the cause of the problem with the timings? Nah, you're talking about one of these caches that Belarc says I have:
8 kilobyte primary memory cache
512 kilobyte secondary memory cache
Right?
Time for one of the über-wizards to chime in, maybe :-) or post the code and results on comp.lang.python and see what they say there.
Dick
Bagdad Weather
< http://weather.yahoo.com/forecast/IZXX0008_f.html>
_______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor