aboutsummaryrefslogtreecommitdiff
path: root/tests/test-custom-ordering-arrayify.el
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-02-03 08:13:01 -0600
committerCraig Jennings <c@cjennings.net>2026-02-03 08:13:01 -0600
commit9754326410c96a2b95aad66d9f98ad1e307326c4 (patch)
treefade7960ce2df833cad6fd50e6b1df6be8f34030 /tests/test-custom-ordering-arrayify.el
parent8ef417db03f8c1fdc6908e85c0666e3f10e34d86 (diff)
downloaddotemacs-9754326410c96a2b95aad66d9f98ad1e307326c4.tar.gz
dotemacs-9754326410c96a2b95aad66d9f98ad1e307326c4.zip
perf(lorem-optimum): fix O(n²) tokenization algorithm
The tokenizer was creating substring copies on every iteration: - (substring text pos (1+ pos)) for whitespace check - (substring text pos) for regex matching - copies ALL remaining text This caused 10K word tokenization to take 727ms instead of 6ms. Fix: Use string-match with start position parameter and check characters directly with aref instead of creating substrings. Performance improvement: - Tokenize 10K words: 727ms → 6ms (120x faster) - Learn 10K words: 873ms → 15ms (59x faster) - Learn 100K words: 70s → 208ms (341x faster)
Diffstat (limited to 'tests/test-custom-ordering-arrayify.el')
0 files changed, 0 insertions, 0 deletions