freebsd-nq/bin/test
Jilles Tjoelker f1602fa511 test: Optimize operator lookup.
The linear search using strcmp() shows up in pmcstat for several percent.

Split the operators into lengths and whether they start with '-' and compare
bytes using == instead of strcmp().

A simple test

sh -c 'i=0; w=$(printf %0100d 7); while [ "$i" -lt 1000000 ]; do
    v=$(printf %sx%s "$w" "$w"); i=$((i+1)); done'

is over 4% faster on an amd64 bhyve VM.
2016-01-30 19:59:58 +00:00
..
tests Clean up trailing whitespace 2015-10-18 05:51:44 +00:00
Makefile Use src.opts.mk in preference to bsd.own.mk except where we need stuff 2014-05-06 04:22:01 +00:00
Makefile.depend Add META_MODE support. 2015-06-13 19:20:56 +00:00
test.1 test(1): Add information about replacing -nt/-ot. 2013-05-31 22:57:04 +00:00
test.c test: Optimize operator lookup. 2016-01-30 19:59:58 +00:00