During the AST migration, _count_concat lost its @lru_cache (it was replaced by an uncached recursive version). Distributing a length L across concat parts then revisited the same (remaining_parts, length) states exponentially -> 16M function calls for a single 4-method group, and several RAGSAK groups took 18-52s (looked hung at the tail). Restore memoization: _count_concat is now @lru_cache-keyed on (tuple(parts), length). Also fix a stray blank line between the @lru_cache decorator and count_words. Impact (RAGSAK, --slice package --min-structure 0.5): straggler groups 18-52s -> <0.5s; full run 54.9s -> 6.7s. Adds a regression test asserting a length-20 (a|b)* string counts in <2s. |
||
|---|---|---|
| .. | ||
| test_analyze.py | ||
| test_bex.py | ||
| test_crx_dotted.py | ||
| test_crx_refined.py | ||
| test_decompose.py | ||
| test_distributional.py | ||
| test_ensemble.py | ||
| test_gbnf.py | ||
| test_grammar.py | ||
| test_grammar_index.py | ||
| test_kore.py | ||
| test_reduce.py | ||
| test_scoring.py | ||