Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A benchmark for UTF-8 parsing performance was added. Using this
benchmark, several strategies for parsing were tested versus the
original lookup table implementation:
Pure match
name pure_lookup ns/iter pure_match ns/iter diff ns/iter diff % speedup
tests::parse_bench_utf8_demo 68,984 52,731 -16,253 -23.56% x 1.31
tests::std_string_parse_utf8 42,472 42,144 -328 -0.77% x 1.01
Match with packed lookup in Ground state
name pure_lookup ns/iter match_and_lookup ns/iter diff ns/iter diff % speedup
tests::parse_bench_utf8_demo 68,984 68,922 -62 -0.09% x 1.00
tests::std_string_parse_utf8 42,472 36,788 -5,684 -13.38% x 1.15
Match with unpacked lookup in Ground state
name pure_lookup ns/iter match_and_lookup_unpacked ns/iter diff ns/iter diff % speedup
tests::parse_bench_utf8_demo 68,984 63,727 -5,257 -7.62% x 1.08
tests::std_string_parse_utf8 42,472 42,787 315 0.74% x 0.99
Of these implementations, the pure match peformed best in
microbenchmarks, and that is the implementation retained in this commit.