about summary refs log tree commit diff
path: root/src/rustllvm/PassWrapper.cpp
diff options
context:
space:
mode:
authorHuon Wilson <dbau.pp+github@gmail.com>2014-02-16 16:11:47 +1100
committerHuon Wilson <dbau.pp+github@gmail.com>2014-02-18 21:55:53 +1100
commita68d10e6adc048b3a5f90e376f232a39223d1db8 (patch)
tree9c97b3429fd7e79aa88c7ecaaa51151475ac0253 /src/rustllvm/PassWrapper.cpp
parentc8489069b43191c5298f17430933b3b88fb79c3c (diff)
downloadrust-a68d10e6adc048b3a5f90e376f232a39223d1db8.tar.gz
rust-a68d10e6adc048b3a5f90e376f232a39223d1db8.zip
std::str: safen and optimize is_utf8.
This uses a vector iterator to avoid the necessity for unsafe indexing,
and makes this function slightly faster. Unfortunately #11751 means that
the iterator comes with repeated `null` checks which means the
pure-ASCII case still has room for significant improvement (and the
other cases too, but it's most significant for just ASCII).

Before:

    is_utf8_100_ascii             ... bench:       143 ns/iter (+/- 6)
    is_utf8_100_multibyte         ... bench:       134 ns/iter (+/- 4)

After:

    is_utf8_100_ascii             ... bench:       123 ns/iter (+/- 4)
    is_utf8_100_multibyte         ... bench:       115 ns/iter (+/- 5)
Diffstat (limited to 'src/rustllvm/PassWrapper.cpp')
0 files changed, 0 insertions, 0 deletions