]> git.lizzy.rs Git - rust.git/commit
Optimize string comparison by using memcmp
authorErick Tryzelaar <erick.tryzelaar@gmail.com>
Thu, 10 Sep 2015 23:46:34 +0000 (16:46 -0700)
committerErick Tryzelaar <erick.tryzelaar@gmail.com>
Thu, 10 Sep 2015 23:46:59 +0000 (16:46 -0700)
commitfbd91a732b73dd73b4da8940bc32c4a7d5e6251b
tree875a5e77354d543a6fbb9707d1f48f86bb610fb6
parent5ff55943a38f2b581bd4ae5d521f57defd1a8b29
Optimize string comparison by using memcmp

llvm seems to be having some trouble optimizing the iterator-based
string comparsion method into some equivalent to memcmp. This
explicitly calls out to the memcmp intrinisic in order to allow
llvm to generate better code. In some manual benchmarking, this
memcmp-based approach is 20 times faster than the iterator approach.
src/libcore/str/mod.rs