Age | Commit message (Collapse) | Author |
|
When benchmarking releases before OTP-22 the
binary:match function is very slow so it takes
a long time to run the benchmarks. This commit
makes the benchmark run for a shorter time which
will make the results a bit less stable, but it
will cut 1 hour from the benchmark regression so
we will have to live with that.
|
|
The idea is to use memchr on the first lookup for
binary:match/2 and also after every match on binary:matches/2.
We only use memchr in case of matches because benchmarks
showed that using memchr even when we had false positives
could negatively affect performance.
This speeds up binary matching and binary splitting by 4x
in some cases and by 70x in other scenarios (when the last
character in the needle does not occur in the subject).
The reason to use memchr is that it is highly specialized
in most modern operating systems, often defaulting to
SIMD operations.
The implementation uses the reduction count to figure out
how many bytes should be read with memchr. We could increase
those numbers but they do not seem to make a large difference.
|
|
statistics(runtime) does not seem to work on some virtual machines.
|
|
|
|
Conflicts:
lib/stdlib/test/stdlib_bench_SUITE.erl
|
|
Limit the time used for the benchmarks introduced in b8f16f0.
|
|
|
|
|
|
|