Unexpected timing results with file I/O
Marc 'BlackJack' Rintsch
bj_666 at gmx.net
Tue Feb 5 02:34:15 EST 2008
On Mon, 04 Feb 2008 21:58:46 +0000, Steven D'Aprano wrote:
> On Mon, 04 Feb 2008 17:08:02 +0000, Marc 'BlackJack' Rintsch wrote:
>
>>> Surprisingly, Method 2 is a smidgen faster, by about half a second over
>>> 500,000 open-write-close cycles. It's not much faster, but it's
>>> consistent, over many tests, changing many of the parameters (e.g. the
>>> number of files, the number of runs per timeit test, etc.).
>>>
>>> I'm using Linux and Python 2.5.
>>>
>>> So, what's going on? Can anyone explain why the code which does more
>>> work takes less time?
>>
>> Can't confirm this (Linux, Python 2.5):
>>
>> Method 1: 15.380897998809814
>> Method 2: 18.085366010665894
>
> Hmmm... does your system use software RAID? Mine does. I wonder if that's
> a relevant factor?
No, test ran on a plain reiserfs partition.
Ciao,
Marc 'BlackJack' Rintsch
More information about the Python-list
mailing list