Compare against '$' directly rather than using MAP_VARIABLE. This
is a ~10% speedup for find_map_function, which is the top hotspot in
QEMU's no-op build. The build is sped up overall by about 1.5% more
(from 11.1 to 10.95 seconds).
* read.c (find_map_function): Do not compare against singleton
Use the stopchar map to quickly jump over everything that is not an
open/close brace, an open/close parenthesis or a comma.
This provides a roughly 1% improvement on QEMU's noop build (from
11.23 to 11.1 seconds).
* function.c (find_next_argument, handle_function): Check
with STOP_SET before comp
* read.c (find_percent_cached): Use strchr instead of STOP_SET
to find % or nul.
* makeint.h (MAP_PERCENT): Remove.
* main.c (initialize_stopchar_map): Remove.
---
main.c| 1 -
makeint.h | 1 -
read.c| 10 +-
3 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/main.c b
In most cases, find_char_unquote has a single stopchar. In that
case we can look for it using strchr's optimized implementation.
The resulting speedup on QEMU's noop build is 3.5% (from 11.78 to 11.37
seconds).
* read.c (find_char_unquote): Rename to find_map_unquote. Replace
with an implementa
This is about twice as fast as the current hash, and removes the need
for double hashing (improving locality of reference). The hash function
is based on Bob Jenkins' design, slightly adapted wherever Make needs
to hash NUL-terminated strings. The old hash function is kept for
case-insensitive ha
Overall, they provide a 15% improvement for my favorite testcase (QEMU's
"no-op" build). These were first sent out last November, but there
have been quite a few changes since then:
- I have dropped the SSE-optimized replacement for strpbrk, because
it does not provide any improvement when test
collapse_continuations is already using strchr to speed up the common
case of no backslash-newline sequence, but on modern processors it is
faster to scan the string twice with strchr+memmove (or strlen+memmove)
than to move bytes manually.
This saves about 1.5% on QEMU's no-op build (from 11.37 t