]> git.kaiwu.me - haproxy.git/commit
[OPTIM] halog: check once for correct line format and reuse the pointer
authorWilly Tarreau <w@1wt.eu>
Sun, 10 Jul 2011 17:47:48 +0000 (19:47 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 11 Jul 2011 04:48:04 +0000 (06:48 +0200)
commit26deaf51d9784183537f1436dd10b20e8cfdb941
treef76285f77bc0a184698e0ca7bd0715607e5de86a
parent758a6ea46cac53d8f4b48e769d5169caaf2afa08
[OPTIM] halog: check once for correct line format and reuse the pointer

Almost all filters first check the line format, which takes a lot of code
and requires parsing back and forth. By centralizing this test, we can
save about 15-20 more percent of performance for all filters.

Also, the test was wrong, it was checking that the source IP address was
starting with a digit, which is not always true with local IPv6 addresses.
Instead, we now check that the next field (accept field) starts with an
opening bracket and is followed by a digit between 0 and 3 (day of the
month). Doing this has contributed a 2% speedup because all other field
calculations were relative to a closer field.
contrib/halog/halog.c