python disk i/o speed
Duncan Booth
duncan at NOSPAMrcp.co.uk
Wed Aug 7 11:03:05 EDT 2002
pruebauno at latinmail.com (nnes) wrote in
news:d8778a53.0208070621.62248e3d at posting.google.com:
> gcc: 4 seconds
> Suns java: 19 seconds
> Python: 36 seconds
>
<snip>
>
> I will post the source of the programms in a follup post. The
> implementation details are not exactly the same. I spent a couple of
> days on a satisfactory ANSI C version for example and about 20 minutes
> on the python script. :-)
>
2 days = 15 hours.
Subtract 20 minutes, give 14 hours, 40 minutes = 52800 seconds
The C version saves you 32 seconds, so you will be gaining with the C
version after only 1650 runs of the program.
If you intend to add up colums of numbers less frequently than about 7Mb
per day for 4 1/2 years, then stick with the Python program. If you need to
process more data than this then post the Python program and we may be able
to make some constructive suggestions.
--
Duncan Booth duncan at rcp.co.uk
int month(char *p){return(124864/((p[0]+p[1]-p[2]&0x1f)+1)%12)["\5\x8\3"
"\6\7\xb\1\x9\xa\2\0\4"];} // Who said my code was obscure?
More information about the Python-list
mailing list