#prefix #suffix #parallelism #simd

fastxfix

Extremely fast prefix/suffix finder for any 2D data type

3 releases

Uses new Rust 2024

0.1.2 May 7, 2025
0.1.1 Apr 27, 2025
0.1.0 Apr 24, 2025

#1006 in Algorithms

Download history 220/week @ 2025-04-23 29/week @ 2025-04-30 185/week @ 2025-05-07 17/week @ 2025-05-14

451 downloads per month

MIT license

22KB
387 lines

FastXFix

Have you ever wanted to find the longest common prefix/suffix of a collection of String values (or any other comparable data type) at ridiculous speed? Well now you can :D


lib.rs:

FastXFix

Have you ever wanted to find the longest common prefix/suffix of a collection of String values (or any other comparable data type) at ridiculous speed? Well now you can :D

Use CommonStr when you expect the LCP/LCS to be a String, and use CommonRaw when you expect it to be Vec<T>.

Do not use CommonRaw when you just want the underlying bytes of an LCP/LCS of a String. CommonStr is specifically optimized for strings, and should always outperform CommonRaw, even when the underlying data is pure ASCII.

*_len methods are provided for when you expect the LCP/LCS to be particularly long and don't want to allocate for it.

Dependencies

~1.5MB
~25K SLoC