]> git.lizzy.rs Git - rust.git/commitdiff
auto merge of #7696 : glinscott/rust/utf8_perf, r=cmr
authorbors <bors@rust-lang.org>
Fri, 12 Jul 2013 10:46:41 +0000 (03:46 -0700)
committerbors <bors@rust-lang.org>
Fri, 12 Jul 2013 10:46:41 +0000 (03:46 -0700)
Moves multibyte code to it's own function to make char_range_at
easier to inline, and faster for single and multibyte chars.

Benchmarked reading example.json 100 times, 1.18s before, 1.08s
after.

Also, optimize str::is_utf8 for the single and multibyte case
Before:
is_utf8_ascii:          272.355162 ms
is_utf8_multibyte:      167.337334 ms

After:
is_utf8_ascii:          218.088049 ms
is_utf8_multibyte:      134.836722 ms


Trivial merge