>From time to time I see Poul-Henning post a junior hacker assignment
to this list, so I figured I'd make the same use of the bandwidth
and mindshare.

A while back OpenBSD "optimized" thier implementation of fdalloc()
buy using a complex two level bitmask to track open slots in the
descriptor table.  After the implementation was ported to FreeBSD
it was discovered that it actually had a negative impact on
performance as world builds seemed to slow down slightly.

An alternative possible optimization would be to overload the
fd_ofiles array to also be a union of pointers to empty slots in
the fd_ofiles array.  It's not as easy as it sounds because you
must make it into a doubly linked list so that entries can be
removed from arbitrary locations so the freelist is kept consistant.

Another trick could be overloading the fd_ofileflags to be the
corresponding back-pointer, this would require that both arrays
fd_ofiles and fd_ofileflags become unions and it would bloat
fd_ofileflags by 4x, but that would save 25% of the bloat of
doubling the size requirement of fd_ofiles.

If anyone wants to take a crack at doing this it'd be interesting
to see the results.  I know it will cost at least doubling the size
of fd_ofiles, but the speed of lookups especially for programs with
a large amount of open files could be signifigant.

-- 
-Alfred Perlstein - [[EMAIL PROTECTED]]
Daemon News Magazine in your snail-mail! http://magazine.daemonnews.org/

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to