Method much slower than function?
Matimus
mccredie at gmail.com
Thu Jun 14 11:13:58 EDT 2007
> The first time you read the file, it has to read it from disk.
> The second time, it's probably just reading from the buffer
> cache in RAM.
I can verify this type of behavior when reading large files. Opening
the file doesn't take long, but the first read will take a while
(multiple seconds depending on the size of the file). When the file is
opened a second time, the initial read takes significantly less time.
Matt
More information about the Python-list
mailing list