Skip to content

Reuse highlighted code across builds through a shared persistent cache. - #39

Merged
koculu merged 2 commits into
mainfrom
perf-cache-for-plugins
Oct 19, 2026
Merged

koculu merged 2 commits into
mainfrom
perf-cache-for-plugins

Conversation

@koculu

@koculu koculu commented Oct 19, 2026

Copy link
Copy Markdown
Member

Summary

Reuse highlighted code across builds through a shared persistent cache, reducing repeated Shiki work while preserving generated output.

Performance

Full frontend site publishing is now approximately 2× faster, completing in 15 seconds instead of 30 seconds.

Changes

  • Add PersistentCache to ts-util-node with buffered JSON shards, atomic writes, inter-process locking, bounded memory, and idle-entry cleanup.
  • Cache standard Shiki output by source, language, themes, and dependency version; initialize Shiki only on a cache miss.
  • Add --no-cache and options.cache: false for highlighting and image optimization.
  • Support optional highlighter flushing after build and development batches, including failures. Include final flushing in completion timing.
  • Update Regor to 1.7.6 consistently across packages.
  • Document cache usage, plugin responsibilities, and CLI behavior in package READMEs and frontend guides.

Validation

  • All 1,151 tests across 115 files passed.
  • TypeScript, plugin contract checks, lint, dependency consistency, line endings, and whitespace checks passed.
  • All 18 distributable packages built and verified.
  • Compiled CLI fixtures verified cold, warm, and uncached runs, with identical CSS and HTML differing only in existing stylesheet timestamps.

@koculu
koculu merged commit 206c4a5 into main Oct 19, 2026
4 checks passed
@koculu
koculu deleted the perf-cache-for-plugins branch October 19, 2026 00:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant