]> git.lizzy.rs Git - rust.git/commit
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)
commitf67935257b19b0904b282c949770d85089fdcf3c
treea3390ee1fa12d5ee8ccd384437feeb96155d82ff
parentd56c9762a363abb5e98f31e43381005863414795
parent8926b31088bdb04d1fa772afa0a7dcbc13b38c1f
auto merge of #7696 : glinscott/rust/utf8_perf, r=cmr

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