Process the input (as quickly as possible) and never fail, but replace each invalid sequence of bytes with U+FFFD (bytes 0xEF 0xBF 0xBD).
Edit: Although, it looks like Rust's std already does this, except for preallocating an exactly correct size result buffer: https://doc.rust-lang.org/src/alloc/string.rs.html#538
[0]: https://github.com/mooman219/fontdue/blob/master/src/platfor...
The Eigen library did recently combine most SSE and AVX code paths, however: https://eigen.tuxfamily.org/index.php?title=3.4
http://openjdk.java.net/jeps/8261663
(I'm completely ignorant on the subject)
I really think the general push right now is towards stdsimd being the future for portability.
It would be great to have things like high-performance unicode handling with consistent semantics across multiple languages!
- https://doc.rust-lang.org/reference/linkage.html
- https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html#call...
I have a sql parsing library (shameless plug) that is 50x faster than any other python implementation, it is just a super simple wrapper around a rust crate.
The https://cxx.rs/ project is also a major crate for C++ interoperability.
https://www.reddit.com/r/rust/comments/mvc6o5/incredibly_fas...
tl;dr: it's not straightforward, mostly because the standard functionality lives in `core` which doesn't have access to OS support for CPU feature detection.
The algorithm is the one from simdjson, the main difference is that it uses an extra step in the beginning to align reads to the SIMD block size.
I didn't really understand this part. Aligned to what? to the cache line? SIMD always reads the block size. Unless I am missing something here.
The plan is for Rust to eventually have a portable SIMD abstraction built into the standard library to reduce the need for CPU-specific code.