encoding_rs
simdutf8
Our great sponsors
encoding_rs | simdutf8 | |
---|---|---|
8 | 15 | |
348 | 505 | |
- | 2.2% | |
6.3 | 3.9 | |
15 days ago | about 2 months ago | |
Rust | Rust | |
GNU General Public License v3.0 or later | GNU General Public License v3.0 or later |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
encoding_rs
-
This Program is Illegally Packaged in 14 Distributions
Author of ripgrep here.
Maybe, umm, don't depend on auto-detection tools as the ultimeate source of whether something is appropriately licensed or not? encoding_rs is clearly licensed, otherwise I wouldn't have used it in ripgrep: https://github.com/hsivonen/encoding_rs
Take it up with the auto-detection tools. Or at least do your due diligence before claiming ripgrep is using "unlicensed" code.
RE: the N/A in ripgrep dependencies specifically, it's a little clearer on my machine (newer version of cargo-license maybe?). Slightly complicated but still above board https://github.com/hsivonen/encoding_rs#licensing
> Custom License File (1): encoding_rs
- Learning to Parse Text Files: BOM!
-
Yore - library for decoding/encoding character sets according to OEM code pages
Have you tried encoding-rs - not to be confused with rust-encoding you've already tried? This is the library used by Firefox, so I expect it to be quite good.
You might also want to include tests, https://github.com/hsivonen/encoding_rs/tree/master/src/test_data could be used as a reference.
-
Show HN: High-speed UTF-8 validation in Rust
As far as I can see it does not use SIMD for UTF8 validation, only likely/unlikely instrinsics, see https://github.com/hsivonen/encoding_rs/blob/e98a2096ab09c92...
I'd be curious how this compares with the encoding_rs crate (https://github.com/hsivonen/encoding_rs), which also offers UTF-8 validation (among many other things).
That's not the only use of SIMD in the crate (e.g. see https://github.com/hsivonen/encoding_rs/blob/e98a2096ab09c92...), but I haven't looked into exactly where/how it's used further.
simdutf8
-
simdutf: Unicode validation and transcoding at billions of characters per second
That's not enough to make it interesting. There's already a porting of it in rust (https://github.com/rusticstuff/simdutf8), and inclusion in the stdlib has already been discussed: the problem is that you can't use simd in all supported targets and conditional compilation/detection is also very tricky.
-
Making Rust Float Parsing Fast: libcore Edition
No, libcore uses simple branching code at the moment, see https://github.com/rust-lang/rust/issues/68455. The issue is still actively being worked on. Note, it's not a simple drop in, and there seem to be even faster algorithms. For now there is https://github.com/rusticstuff/simdutf8.
-
What's everyone working on this week (19/2021)?
I will work on simdutf8, either
-
simdutf v0.1.1 - A small step for semver, one giant leap for performance.
Now I have to benchmark again, it might be negligable. See also the discussion for this pull request.
-
Show HN: High-speed UTF-8 validation in Rust
Check the benchmarks section (https://github.com/rusticstuff/simdutf8#Benchmarks), second table. simdutf8 is up to 28 % faster on my Comet Lake CPU. However with pure ASCII clang does something magical with simdjson and it beats my implementation by a lot. GCC-compiled simdjson is slower all around except for a few outliers with short byte sequences.
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.
-
Incredibly fast UTF-8 validation
ARM SIMD intrinsics are currently unstable and many are not yet implemented. But work to add them is ongoing and it should be possible. I will look into it. See issue #1
Yes, it is now also listed in the References section. The only difference is that it does 32-byte-aligned reads which proves to be a bit faster even on modern architectures since it is the SIMD register width and reads do not cross cachelines. Also, the compat API flavor checks every 64-byte block if invalid data has been encountered and calculates the error position using std::str::from_utf8().
What are some alternatives?
serde - Serialization framework for Rust
sqloxide - Python bindings for sqlparser-rs
simdutf - Unicode routines (UTF8, UTF16, UTF32): billions of characters per second using SSE2, AVX2, NEON, AVX-512, RISC-V Vector Extension. Part of Node.js and Bun.
cxx - Safe interop between Rust and C++
icu4x - Solving i18n for client-side and resource-constrained environments.
simdjson - Parsing gigabytes of JSON per second : used by Facebook/Meta Velox, the Node.js runtime, ClickHouse, WatermelonDB, Apache Doris, Milvus, StarRocks
bumpalo - A fast bump allocation arena for Rust
fast_float - Fast and exact implementation of the C++ from_chars functions for number types: 4x to 10x faster than strtod, part of GCC 12 and WebKit/Safari
feel
fast-float-rust - Super-fast float parser in Rust (now part of Rust core)