Skip to content

Theme: Improve build performance #26

@marcuspollio

Description

@marcuspollio

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Cleanup/refactorCode cleanup or refactor with no functional changeConfigConfigurationHugoHugo dependencyThemeTheme code and related items

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions