ekp/tests
Kinneyzhang bed359d439 perf: session-global width cache; fix two cache-aliasing bugs
Measurement was the largest cost outside the DP and entirely outside
the C module's reach.  Boxes repeat across paragraphs constantly
(CJK text re-uses a small alphabet of glyphs), yet each paragraph
measured its own copies: 43% of string-pixel-width calls on the
bundled Chinese sample were cross-paragraph duplicates.

- new session-global box-to-width cache behind all measurement sites
  (boxes, styled hyphens, protrusion tails); paragraph-local dedup
  stays as the first level.  Same machine, byte-compiled, elisp
  engine: para-create -26%, justify zh w=400 -41%, justify zh w=200
  -8% (cold), no case slower.  ekp-clear-caches flushes it (needed
  after font/theme changes, as before).
- cache keys (paragraph and width) now strip 'fontified' and other
  volatile bookkeeping properties: font-lock flipping 'fontified'
  as text scrolled halved the paragraph-cache hit rate in fontified
  buffers by aliasing one paragraph into several entries.
- fix: dp-cache results are now keyed by looseness too -- a cached
  looseness-0 layout was returned after 'ekp-looseness' changed
  (reproduced: 3-line stale result where a fresh run gives 4).
- fix: variable watchers invalidate the same-string fast path when a
  style variable changes -- (setq ekp-alignment 'center) kept
  returning the paragraph resolved under the previous style for
  callers reusing the same string object.
- render path fetches the dp plist once instead of three lookups.

4 new ERT tests (88 total); fuzz 300/300 with C parity.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-27 01:21:15 +08:00
..
ekp-bench.el refactor!: overhaul KP core — correctness, C parity, performance, tests, docs 2026-07-26 18:44:02 +08:00
ekp-demo.el feat: whole-buffer commands, DWIM, M-q remap, org/markdown wiring 2026-07-27 01:08:40 +08:00
ekp-fuzz.el refactor!: overhaul KP core — correctness, C parity, performance, tests, docs 2026-07-26 18:44:02 +08:00
ekp-region-tests.el perf(region): smarter lazy re-flow scheduling 2026-07-27 01:11:05 +08:00
ekp-showcase.el feat: whole-buffer commands, DWIM, M-q remap, org/markdown wiring 2026-07-27 01:08:40 +08:00
ekp-tests.el perf: session-global width cache; fix two cache-aliasing bugs 2026-07-27 01:21:15 +08:00
run-tests.sh feat: buffer-level justification — region commands and auto-justify mode 2026-07-26 20:23:03 +08:00
text-de_DE.txt update readme 2025-07-27 21:35:44 +08:00
text-en_US.txt update readme 2025-07-27 21:35:44 +08:00
text-fr.txt update readme 2025-07-27 21:35:44 +08:00
text-zh2-en_US.txt fix _ local variable bug 2025-07-28 16:58:30 +08:00
text-zh-en_US.txt fix bug when text is blank string 2025-09-26 00:18:37 +08:00
text-zh.txt add chinese example 2025-07-28 00:33:53 +08:00