a possible micro-optimization

Poul-Henning Kamp phk at phk.freebsd.dk
Tue Apr 27 11:41:50 UTC 2021

This is a crudely hacked together proof-of-concept where a "perfect hash"
is used to find out if a given HTTP header has filtering flags.

I expect, but am far from sure, that this will perform better than the
current sequential code.

If anybody has a chance to beat this up in some kind of a performance
test, I would be very interested to hear the results.

Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: _phash.patch
Type: text/x-diff
Size: 5052 bytes
Desc: _phash.patch
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-dev/attachments/20210427/7c419163/attachment.bin>

More information about the varnish-dev mailing list