need fast parser for comma/space delimited numbers

Tony McDonald tony.mcdonald at ncl.ac.uk
Sun Mar 19 19:25:11 CET 2000


In article <etditykrz7w.fsf at w20-575-109.mit.edu>, Alex 
<alex at somewhere.round.here> wrote:
d like to drop that down to a minute of possible.
> 
> Hmm, I must be missing something.  The following code takes about 8s on
> a Sparc 10 and about 5 on a Linux w/ pentium II 400MHz.
> 
> import string, time
> 
> line = '356 0.23514  0.1784'
> 
> start_time = time.time ()
> for i in 90000 * [None]:
>     split_line = filter (None, string.split (line))
>     n = int (split_line [0])
>     x = float (split_line [1])
>     y = float (split_line [2])
> 
> print time.time () - start_time    


sorry to be wildly off-topic here, but what pystones are you getting on 
your Sparc 10?
I ask because we're getting pretty poor performance from our Sun 
hardware here. eg

180MHz 603e (LinuxPPC) pystones = 890
266MHz G3 (iMac, MacOS) pystones = 4600 (code takes 4.5 seconds)
300MHz? Ultrasparc (Solaris) pystones = 2500  (code takes 8.5 seconds)
500MHz Pentium III (SUSE Linux) pystones = 5500
700MHz Pentium III (Win32) pystones = 10120

...and I'd really like to get the numbers up on the Sun iron (if that's 
possible)

I couldn't get numbers on the Pentiums at the moment, and have no idea 
why the pystones are so different for the sake of 200MHz of processor.

Thanks
tone.

-- 
To get random signatures put text files into a folder called ³Random Signatures² into your Preferences folder.



More information about the Python-list mailing list