mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-10-30 08:16:49 +00:00
perf: build log-mask automaton as a contiguous nfa (#12088)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
d03142ba39
commit
97de072e7f
@@ -184,7 +184,11 @@ fn compile(secrets: &HashSet<String>) -> CompiledMasks {
|
||||
})
|
||||
.collect();
|
||||
|
||||
// Built once per job (its token is always a secret) and searched over little log text, so
|
||||
// the default DFA's build cost dominates; a contiguous NFA searches as fast here since
|
||||
// the literal prefilter does the scanning.
|
||||
let ac = aho_corasick::AhoCorasickBuilder::new()
|
||||
.kind(Some(aho_corasick::AhoCorasickKind::ContiguousNFA))
|
||||
.match_kind(aho_corasick::MatchKind::LeftmostLongest)
|
||||
.build(sorted.iter().map(|s| s.as_str()))
|
||||
.expect("failed to build aho-corasick automaton");
|
||||
|
||||
Reference in New Issue
Block a user