lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev local directory listing - TOO SLOW


From: Bela Lubkin
Subject: Re: lynx-dev local directory listing - TOO SLOW
Date: Sun, 10 Jan 1999 16:41:52 -0800

Mike Castle wrote:

> Amazingly enough Bela Lubkin said:
> > getpwuid() and getgrgid() are slow, on my system, because they open,
> > read, and close the appropriate file (/etc/passwd or /etc/group) every
> > time.  Maybe other libc implementations cache this information.  If not,
> > this might be a good candidate for a little cache inside HTLoadFile().
> > It doesn't need to be persistent across calls.
> 
> A look at idcache.c from GNU fileutils might also provide a bit of help.

Yeah, that looks like it would do just fine.

> Also, I'm wondering if locality of code might affect this any.
> 
> It looks like ls (at least GNU ls) stats all the files, then goes to look
> up the owners, whereas lynx gathers up the other info after each stat.
> Perhaps rearranging the code might help a bit here as well by improving
> locality and letting systems with caches on the CPU's make use of them a
> bit more.

I doubt this would make any noticable difference, as long as [ug]id's
are being cached.  It might also help to use a setpwent(), repeat
getpwent() loop to fill that cache, rather than specific getpwuid() for
each new ID.  (But that could cost a lot of memory on systems with large
/etc/passwd.)

>Bela<

reply via email to

[Prev in Thread] Current Thread [Next in Thread]