diff options
author | glebius <glebius@FreeBSD.org> | 2012-01-23 16:43:13 +0000 |
---|---|---|
committer | glebius <glebius@FreeBSD.org> | 2012-01-23 16:43:13 +0000 |
commit | 09b7b48405f73979d884c854decab97c9b85b266 (patch) | |
tree | 9f93c1c6462a8a90d4240ad1ce0cd102fc8430c6 /share | |
parent | 18321230d6cae24968b5414a59466336822cc449 (diff) | |
download | FreeBSD-src-09b7b48405f73979d884c854decab97c9b85b266.zip FreeBSD-src-09b7b48405f73979d884c854decab97c9b85b266.tar.gz |
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.
Diffstat (limited to 'share')
0 files changed, 0 insertions, 0 deletions