Skip to content

Conversation

@CybotTM
Copy link
Contributor

@CybotTM CybotTM commented Jan 22, 2026

Summary

Caches the compiled Symfony DI container to /tmp/guides-container-cache/ for faster CLI startup times.

Changes

  • ContainerFactory: Cache compiled container using PhpDumper
    • Generates unique cache key from vendor directory path
    • Stores compiled container as PHP class file
    • Automatic invalidation when container configuration changes
    • Graceful fallback when container has uncacheable parameters

Performance Impact

Container compilation is skipped on subsequent runs, reducing startup time. Most beneficial for development workflows with frequent CLI invocations.

See Performance Analysis Report for detailed benchmarks.


Related PRs

PR Description Status
#1287 Rendering caching layer Independent
#1288 RST parsing optimizations Independent
#1289 This PR - CLI container caching
#1291 Symfony 8 compatibility ✅ Merged
#1293 ProjectNode O(1) document lookup Independent

All PRs can be merged independently in any order.

Cache the compiled Symfony DI container to /tmp/guides-container-cache/.
On subsequent runs, loads pre-compiled PHP class instead of rebuilding
the entire container (config parsing, service registration, compilation).

Cache key includes vendor dir, working dir, extensions, and configs to
ensure cache invalidation when configuration changes.

See https://cybottm.github.io/render-guides/ for benchmark data.
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