While the current theme code is fairly decent (about 1ms per page on 5K pages and almost 1K processed images, about 5s in total on old laptop CPU), there are many improvements and optimizations possible:
Template:
- Better cache: see Hugo docs for
hugo build --templateMetrics --templateMetricsHints for templates with many calls
- Reduce nested loops in templates: avoid
O(n²) complexity
- Reduce expensive calls: site pages or collections traversals, filtering and sorting
- Reduce image and assets pipelines to strictly needed, caching artifacts if reusable between cover, cards, render-hooks
Config:
- Optimize settings and config
- Make better use of segments
While the current theme code is fairly decent (about 1ms per page on 5K pages and almost 1K processed images, about 5s in total on old laptop CPU), there are many improvements and optimizations possible:
Template:
hugo build --templateMetrics --templateMetricsHintsfor templates with many callsO(n²)complexityConfig: