Multi-pattern Match
v0.1.0Added Sep 26, 2026Sample dataAho–Corasick matching of thousands of patterns in one pass, for scanning logs and payloads for indicators of compromise.
cargo install kura-rs
kura add multi-pattern-matchCopies the source file into your project. You own the code from then on.
If another tool already installs a kura command, run cargo install kura-rs --bin kura-rs and use kura-rs add instead.
use crate::parts::multi_pattern_match::Matcher;
let matcher = Matcher::new(&iocs);
for hit in matcher.find_all(&payload) {
alert(hit.pattern, hit.offset);
}Verification
Sample dataChecked against pyahocorasick 2.1.0 (Python) using differential testing: the same inputs go to both implementations and the outputs are compared.
These numbers are placeholders. They have not been measured yet and must not be read as real results. This part is marked "sample": true in its registry file.
Benchmarks
Sample datakura-rs (Rust) against pyahocorasick across input sizes. Faster at every measured input size, up to 5.0× faster.
These numbers are placeholders. They have not been measured yet and must not be read as real results. This part is marked "sample": true in its registry file.
Show data table
| Input size | kura-rs (Rust) | pyahocorasick | Speedup |
|---|---|---|---|
| 1,000 | 0.02 ms | 0.05 ms | 2.5× |
| 10,000 | 0.14 ms | 0.52 ms | 3.7× |
| 100,000 | 1.3 ms | 5.8 ms | 4.5× |
| 1,000,000 | 13 ms | 61 ms | 4.7× |
| 10,000,000 | 128 ms | 640 ms | 5.0× |
Files
- parts/multi_pattern_match/mod.rs