[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdelibs/kdeui/icons
From:       Andreas Hartmetz <ahartmetz () gmail ! com>
Date:       2007-07-20 12:19:11
Message-ID: 200707201419.12105.ahartmetz () gmail ! com
[Download RAW message or body]

On Friday 20 July 2007 13:52:28 Thomas Zander wrote:
> On Friday 20 July 2007 13:04:04 Rivo Laks wrote:
> > > Why not use KLockFile everywhere, to keep the code simple and
> > > portable?
> > >
> > > ifdefs have a tendency to break since any change is only tested on
> > > half the code paths...
> >
> > KLockFile should to be slower than just flock() as it does lots of
> > stuff which I don't really need. So for performance reasons I decided
> > to use just flock() (and no, i haven't actually profiled how much
> > slower it is).
>
> Is the speed difference so big that it warrents the extra maintenance
> problems ?
> Since this is about disk access some extra code doesn't seem a bit deal;
> the bottleneck will most likely be the disk anyway.

Let's do the math:
A disk seek is about 10 ms, in which time a 2 GHz processor goes through
2*10^9 * 10^-2 = 2*10^7 cycles (that's twenty million cycles!)

Everybody knows that the disk is often the bottleneck, this is just to remind 
you how slow it is compared to the CPU and even main memory.

If you have many disk seeks there is often nothing else that matters 
performance-wise.

Cheers,
Andreas

-- 
Sizzling weasels on a stick
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic