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> |
||
|---|---|---|
| .. | ||
| ekp-bench.el | ||
| ekp-demo.el | ||
| ekp-fuzz.el | ||
| ekp-region-tests.el | ||
| ekp-showcase.el | ||
| ekp-tests.el | ||
| run-tests.sh | ||
| text-de_DE.txt | ||
| text-en_US.txt | ||
| text-fr.txt | ||
| text-zh2-en_US.txt | ||
| text-zh-en_US.txt | ||
| text-zh.txt | ||