Skip to content

Avoid re-rendering readmes#461

Closed
BenjaminSchaaf wants to merge 1 commit into
packagecontrol:gh-pagesfrom
sublimehq:cache-readme-rendering
Closed

Avoid re-rendering readmes#461
BenjaminSchaaf wants to merge 1 commit into
packagecontrol:gh-pagesfrom
sublimehq:cache-readme-rendering

Conversation

@BenjaminSchaaf

Copy link
Copy Markdown
Contributor

The readme rendering is slow and memory intensive, but there's no reason to redo all that work every time. We now store a hash of the text used to render the readme inside readmes_renderes.json to avoid re-rendering.

When no readme has changed this bring rendering time from ~30s to ~700ms and of course significant memory savings.

FWIW I did a quick and dirty rewrite in rust and a full uncached render takes just 2s and ~50MB of RAM.

The readme rendering is slow and memory intensive, but there's no reason
to redo all that work every time. We now store a hash of the text used
to render the readme inside readmes_renderes.json to avoid re-rendering.
@kaste

kaste commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

Cherry-picked. The main problem with this commit was that it only considered the source text to invalidate the cache, but the other side, the renderer, can also change. Also the root cause should be fixed as we really run out-of-memory here quickly. With the root fix applied, the question was if we should cache at all as caches can become stale but I still went with it as it really seems natural to do so.

The follow-up is #462

@kaste kaste closed this Jul 22, 2026
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.

2 participants