Hacker News new | ask | show | jobs
by kibwen 3396 days ago
> one line of unsafe code (a call to the libc "memchr" function)

Is burntsushi's Rust implementation of memchr notably slower than libc's?

2 comments

The rust-memchr crate uses libc's memchr if it's available and known to be fast. Otherwise, it falls back to a pure Rust implementation (written by bluss, not me).

I expect this to change once we get SIMD. ;-)

> Is burntsushi's Rust implementation of memchr notably slower than libc's?

Not as far as I know. A lot of this benchmarksgame code has evolved slowly over time and hasn't been cleaned up yet to use "modern" crates and language features.