Repolode
ashvardanian

ashvardanian/StringZilla

A SIMD- and SWAR-accelerated string library for C, C++, Python, Rust, JavaScript, Go and more, covering search, hashing, sorting and edit distances.

Stars
3,574
Forks
145
Open issues
33
Last commit
13 hours ago

What is it?

StringZilla is a text-processing library that uses SIMD and SWAR CPU instructions to speed up common string operations such as substring and character-set search, hashing, sorting, Levenshtein and alignment scoring, and Unicode case folding and segmentation. It is designed to be a drop-in companion to standard APIs: for example, Python's str.find, C's strstr and C++'s std::string::find have direct StringZilla equivalents.

The core is a single-header C library with a C++ wrapper, and bindings are provided for Python, Rust, JavaScript, Swift, Go, C# and Java. A second layer, StringZillas, adds parallel CPU and CUDA GPU backends for batch edit distances, alignment scores and rolling fingerprints. The project also includes a hash function based on AES instructions and SHA-256 implementations that use hardware SHA extensions where available.

The library targets x86, Arm, RISC-V, PowerPC and WebAssembly, and aims to be portable across endianness, word sizes and operating systems. Feature maturity varies by binding, and the project marks some Unicode functions as still under active development.

Key features

  • 01Substring and character-set search accelerated with SIMD and SWAR instructions.
  • 02Hashing with a 64-bit AES-based function and hardware-accelerated SHA-256.
  • 03Sorting and set intersection over string collections.
  • 04Levenshtein and Needleman-Wunsch distances, with batched GPU execution via CUDA.
  • 05Unicode case folding, UTF-8 handling and TR29 segmentation.
  • 06Bindings for C, C++, Python, Rust, JavaScript, Swift, Go, C# and Java.

Use cases

  • Speeding up text-heavy data pipelines that parse large corpora.
  • Replacing slow substring or hashing calls in performance-sensitive services.
  • Batch computing edit distances or alignment scores for bioinformatics or search workloads.
  • Accelerating LIKE, ORDER BY and GROUP BY style operations inside a database engine.

Quick start

  1. 1

    Install the Python package

    pip install stringzilla
  2. 2

    Use it from Python in place of str

Things to know

  • Not every feature is available in every language binding.
  • Several Unicode features (normalization, segmentation, line-break detection) are still marked as work in progress.

In collections

Topics

FAQ

What is StringZilla?
A SIMD- and SWAR-accelerated string library for C, C++, Python, Rust, JavaScript, Go and more, covering search, hashing, sorting and edit distances. StringZilla is a text-processing library that uses SIMD and SWAR CPU instructions to speed up common string operations such as substring and character-set search, hashing, sorting, Levenshtein and alignment scoring, and Unicode case folding and segmentation. It is designed to be a drop-in companion to standard APIs: for example, Python's str.find, C's strstr and C++'s std::string::find have direct StringZilla equivalents.
Is StringZilla free to use? What license does it have?
StringZilla is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
Is StringZilla still maintained?
Actively maintained. The last commit to StringZilla was on Oct 22, 2026.
What can I use StringZilla for?
Speeding up text-heavy data pipelines that parse large corpora. Replacing slow substring or hashing calls in performance-sensitive services. Batch computing edit distances or alignment scores for bioinformatics or search workloads. Accelerating LIKE, ORDER BY and GROUP BY style operations inside a database engine.
How do I install StringZilla?
Install the Python package: pip install stringzilla Use it from Python in place of str
Where can I get StringZilla?
The source code and installation instructions are on GitHub: https://github.com/ashvardanian/StringZilla

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects