Subject: Re: Making file-based getXent quicker
To: None <tech-userlevel@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-userlevel
Date: 03/20/2006 14:03:49
> One other thing I'm highly curious about here is why we should think
> that most requests from these databases don't hit in every relevant
> cache along the way to being resolved.  Is there really much
> performance benefit to looking an entry up in shared memory when
> compared to retrieving it from the filesystem cache, with the
> filename lookup handled by the name cache?

Yes.  At a minimum, the file-based lookup is three syscalls, usually
four (open, read, close, usually with a second read in there).  Shared
memory is typically two syscalls the first time (open, mmap - or just
one, shmat, if you use SV-style shm) and *none* thereafter.

The major downside I see is that it's harder to pick up changes to the
database in a long-running program.  (This can be viewed as a bug or a
feature, depending on what semantics you want.)

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B