[Tutor] Why does counting to 20 million stress my computer? (original) (raw)
Nick Lunt nick at javacat.f2s.com
Sat Jul 17 02:02:35 CEST 2004
- Previous message: [Tutor] Why does counting to 20 million stress my computer?
- Next message: [Tutor] Why does counting to 20 million stress my computer?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Chris,
My setup is Athlon 3200+ Barton with 1GB RAM, my bios recognises this as approx 2.2Ghz. Also my motherboard runs at 400Mhz FSB.
using range(50000000): 18.281 seconds using xrange(50000000): 13.516 seconds
You sure you didnt type in 500000000 ;)
So xrange is definitely quicker. Is it better to use xrange all the time in place of range then ?
Regards Nick.
-----Original Message----- From: tutor-bounces+nick=javacat.f2s.com at python.org [mailto:tutor-bounces+nick=javacat.f2s.com at python.org]On Behalf Of Chris Irish Sent: 17 July 2004 00:35 To: Dick Moores Cc: tutor at python.org Subject: Re: [Tutor] Why does counting to 20 million stress my computer?
Dick Moores wrote:
I was just fooling around writing a script (below) that would show how fast my computer can count. I was pleased with the speed, but dismayed that counting to a mere 15 or 20 million reduced available memory from about 300 to close to zero, forcing a reboot; and sometimes upon rebooting I would find some important Win XP settings changed. Do I have to get a CS degree to understand what's going on? Or can someone point me to an explanation?
Some results: 0 to 9999999 in 7.641 seconds! 0 to 1000000 in 0.766 seconds! 0 to 100000 in 0.078 seconds! 0 to 50000 in 0.031 seconds! 0 to 10000 in 0.000 seconds! On my Powerbook G4 @ 1Ghz with 1 GB SDRAM it took me 228.033 seconds to count to 50 million.......Cool Does anyone have a 2.5 Ghz or faster P4 that can run Dick's program? I'm curious to just how much faster those newer processors really are from Intel :) Thanks Chris
Tutor maillist - Tutor at python.org http://mail.python.org/mailman/listinfo/tutor
- Previous message: [Tutor] Why does counting to 20 million stress my computer?
- Next message: [Tutor] Why does counting to 20 million stress my computer?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]