Method much slower than function?
mccredie at gmail.com
Thu Jun 14 17:13:58 CEST 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.
More information about the Python-list