Dailydave mailing list archives
Re: A small fun Python puzzle
From: Jeremy Kelley <jeremy () austin ibm com>
Date: Tue, 1 Apr 2008 14:19:56 -0500
The proprietor said to send this to the list. -j Quoting Dave Aitel (dave () immunityinc com): |> -----BEGIN PGP SIGNED MESSAGE----- |> Hash: SHA1 |> |> Jeremy Kelley wrote: |> | btw, you're using the StringIO module to correct the problem, right? |> | I forgot to mention that yesterday. |> | |> | -j |> | |> Nah, we just read in 1024 bytes of the file at a time ... makes life a lot |> easier. :> |> |> - -dave | | I typed up an email saying how StringIO would be faster than multiple | reads of a filehandle then decided to write a quick test. I was wrong. | | My tests actually show that on avg, multiple reads from a file handle | (on my laptop only) are approximately 5-15% faster for file sizes up to | 32000000 bytes. Then, they even out and StringIO becomes a little | faster until the size of the file hits a certain size and my laptop ram | fills up. At that point, StringIO is twice the time as reading from the | file handle. | | So, in summary. I'm wrong about StringIO. Yay for learning! | | That's my .02. I'll let it die now. :) | | -j -- Jeremy Kelley <jeremy () austin ibm com> Sr. Threat Analyst gpg 1024D/E0DF8B2D 4BC3 B8B5 5B42 CC8E B6A9 2E85 32D3 C51C E0DF 8B2D That's the problem with science. You've got a bunch of empiricists trying to describe things of unimaginable wonder. -Bill Watterson _______________________________________________ Dailydave mailing list Dailydave () lists immunitysec com http://lists.immunitysec.com/mailman/listinfo/dailydave
Current thread:
- Re: A small fun Python puzzle Daryl Tester (Apr 01)
- Re: A small fun Python puzzle ergosum (Apr 01)
- <Possible follow-ups>
- Re: A small fun Python puzzle Jeremy Kelley (Apr 01)