for faster execution.
This new code short-circuits out of the inner scanning loop
after a single comparison when it hits a character not in the
"<!--#" pattern. Compared to the previous code, this version
does more work for characters in the pattern and less work for
characters not in the pattern. In practice, the net result
seems to be a speedup for typical shtml files, where characters
in the pattern are less common than characters not in the pattern.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92604
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.30-dev
+ *) More performance tweaks to the BNDM string-search algorithm
+ used to find "<!--#" tokens in mod_include [Brian Pane]
+
*) Miscellaneous small performance fixes: optimized away various
string copy operations and removed large temp buffers from
the stack [Brian Pane]
he = h + hl;
T = t->T;
- x = t->x << 1;
+ x = t->x;
pi = h - 1; /* pi: p initial */
p = pi + nl; /* compare window right to left. point to the first char */
skip = p;
d = x;
do {
- d = (d >> 1) & T[(unsigned char) *p--];
+ d &= T[(unsigned char) *p--];
+ if (!d) {
+ break;
+ }
if ((d & 1)) {
if (p != pi)
skip = p;
else
return p - h + 1;
}
- } while (d > 1);
+ d >>= 1;
+ } while (d);
+
pi = skip;
p = pi + nl;
}