Skip to content

Why does perf-literal requires std? #1147

Answered by BurntSushi
Palkovsky asked this question in Q&A
Discussion options

You must be logged in to vote

I created a PR for (1): #1148

For (2), that is an interesting question. The purpose of the perf-literal-* features is to enable the use of SIMD when searching. And for the aho-corasick crate, it needs to depend on std to enable SIMD. The reason is that CPU feature detection is only available in std, and that's needed to introspect (at least on x86-64) whether the necessary ISA extensions are available to employ SIMD. If std isn't enabled, then probably there isn't much point in enabling perf-literal-multistring.

But why doesn't perf-literal-substring also enable std? Well, in that case, the crate providing SIMD is memchr. And in that case, the algorithms are sufficiently simple enough tha…

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Palkovsky
Comment options

@Palkovsky
Comment options

Answer selected by Palkovsky
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants