Gleb Smirnoff 48a47609bc Provide a findhook method for ng_socket(4). The node stores a
hash with names of its hooks. It starts with size of 16, and
grows when number of hooks reaches twice the current size. A
failure to grow (memory is allocated with M_NOWAIT) isn't
fatal, however.

I used standard hash(9) function for the hash. With 25000
hooks named in the mpd (ports/net/mpd5) manner of "b%u", the
distributions is the following: 72.1% entries consist of one
element, 22.1% consist of two, 5.2% consist of three and
0.6% of four.

Speedup in a synthetic test that creates 25000 hooks and then
runs through a long cyclce dereferencing them in a random order
is over 25 times.
2012-01-23 16:43:13 +00:00
..
2011-07-06 09:43:25 +00:00
2011-07-25 09:12:48 +00:00
2012-01-16 12:33:55 +00:00
2012-01-02 12:12:10 +00:00
2010-06-10 16:45:30 +00:00
2010-04-07 16:29:10 +00:00
2010-04-01 10:41:01 +00:00