Skip to content

Commit

Permalink
doc: add a FIXME about a perf problem
Browse files Browse the repository at this point in the history
I noticed this when running the rebar benchmarks. Some of the DFA
compilation benchmarks seem to have regressed.
  • Loading branch information
BurntSushi committed Oct 9, 2023
1 parent 3c475c5 commit 12025c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/dfa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,15 @@ impl Builder {
if anchored.is_anchored() {
oldnextsid = noncontiguous::NFA::DEAD;
} else {
// FIXME: This is a perf problem that got worse
// when I changed the non-contiguous NFA to
// use a linked list to represent each state's
// transitions. We decreased memory usage
// (especially peak memory usage) quite a bit, but
// state transitions became quite a bit slower.
// Perhaps the Pareto principle applies here and
// we can use a small cache for very hot failure
// transitions? Not sure.
oldnextsid = nnfa.next_state(
Anchored::No,
state.fail(),
Expand Down

0 comments on commit 12025c5

Please sign in to comment.