docs.rs failed to build jetscii-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
jetscii-0.5.3
Jetscii
A tiny library to efficiently search strings for ASCII characters.
Example
use AsciiChars;
let mut search = new;
search.push;
search.push;
let part_number = "86-J52:rev1";
let parts: = part_number.split.collect;
assert_eq!;
What's so special about this library?
We use a particular x86-64 SSE 4.2 instruction (PCMPESTRI
) to gain
great speedups. This method stays fast even when searching for one
character in a set of up to 8 choices.
When PCMPESTRI
is not available, we fall back to a
universally-supported byte iterator method.
Benchmarks
Single character
Searching a 5MiB string of a
s with a single space at the end:
Method | Speed |
---|---|
str.find(AsciiChars) |
6501 MB/s |
`str.as_bytes().iter().position( | &v |
`str.find( | c |
str.find(' ') |
1085 MB/s |
str.find(&[' '][..]) |
602 MB/s |
str.find(" ") |
293 MB/s |
Set of characters
Searching a 5MiB string of a
s with a single ampersand at the end:
Method | Speed |
---|---|
str.find(AsciiChars) |
6480 MB/s |
`str.as_bytes().iter().position( | &v |
`str.find( | c |
str.find(&['<', '>', '&'][..]) |
361 MB/s |
Contributing
- Fork it ( https://github.com/shepmaster/jetscii/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Add a failing test.
- Add code to pass the test.
- Commit your changes (
git commit -am 'Add some feature'
) - Ensure tests pass.
- Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request