localshred/protobuf — pull request #114 by devin-c (2013-08-26 21:53:59+00:00)
Title: Increase directory lookup speed

This improves lookup speed in a number of ways. The mutex locking has
been removed, which I believe is the primary culprit of the increased
lookup times. Writing new listings only happens in a single thread, so
the mutex was an unnecessary precaution.

Additionally, the listings are now hashed by service name for the lookup
method, and expiration has been attached to a timer (see #run) to
keep the lookup hash up to date. This allowed me to remove all iteration
from the lookup process (except perhaps for an unlikely hash collision).

The private and public interfaces are now better defined, and the specs
have been re-written to avoid looking at the private interface (trying to
apply [what I learned from Sandi Metz](http://bit.ly/ZwV4U3)).

cc: @abrandoned @liveh2o @brianastien