]> err.no Git - varnish/commit
Rework the classic hasher to reduce lock contention and CPU usage.
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 22 Aug 2006 07:52:33 +0000 (07:52 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Tue, 22 Aug 2006 07:52:33 +0000 (07:52 +0000)
commiteb4490a0354c921543ee7373d0aa3ee23edbf3a5
tree4a4a7d56c5317f987406defa988650c01e073281
parent506ebdab041fd62bfe100d83d93e9b99ca14ee31
Rework the classic hasher to reduce lock contention and CPU usage.

Make nbuckets=nhash mandatory.

Order hash lists by the length of key instead of the key contents,
comparing the length is much faster.

Also compare disgest before we take the expensive content compare.

Use memcmp() for content compare instead of strcmp().

Use a two-pass algorithm for inserts to lower mutex contention.

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@884 d4fa192b-c00b-0410-8231-f00ffab90ce4
varnish-cache/bin/varnishd/hash_classic.c