Re: [RFC/PATCH] inotify -- a dnotify replacement



On Tue, 2004-05-11 at 14:30, Ross Burton wrote:
> On Tue, 2004-05-11 at 12:52, nf wrote:
> > I would even claim, that simple polling ("stat"-ing) the filesystem for
> > changes is more efficient in 95% of the cases, than all this dnotify,
> > fam, etc... stuff.
> 
> Do you have any idea how many files GNOME is watching?  Every file in
> your open Nautilus windows, plus the desktop, plus every .desktop file
> in your panel menu.  Stat-ing that lot would be seriously slow, and
> rather intense.
> 
> Ross

One million stat() calls take less than 2 seconds on my computer (athlon
xp2000). - 2 microseconds per call! This seems negligible compared to
all the trouble and complexity we get with xinetd, fam, dnotify,...
At least on an average workstation...

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main() {
                                                                                        	struct stat buffer;
        int         status;
        int i;

        for (i=0;i<1000000;i++) {

                status = stat("/bin/bash", &buffer);
        }
        return 0;
}

Norbert






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]