Merge commit '5be51ac3db225d5df501ed1fa1499c41d97dbf65'

This commit is contained in:
Bjørn Erik Pedersen
2025-04-10 13:04:51 +02:00
987 changed files with 12379 additions and 14083 deletions

View File

@@ -1,14 +1,8 @@
---
title: Performance
description: Tools and suggestions for evaluating and improving performance.
categories: [troubleshooting]
categories: []
keywords: []
menu:
docs:
parent: troubleshooting
weight: 60
weight: 60
toc: true
aliases: [/troubleshooting/build-performance/]
---
@@ -24,9 +18,8 @@ For example, with Microsoft Defender Antivirus:
Then type `hugo.exe` add press the **Add** button.
{{% note %}}
Virus scanning exclusions are common, but use caution when changing these settings. See the [Microsoft Defender Antivirus documentation](https://support.microsoft.com/en-us/topic/how-to-add-a-file-type-or-process-exclusion-to-windows-security-e524cbc2-3975-63c2-f9d1-7c2eb5331e53) for details.
{{% /note %}}
> [!note]
> Virus scanning exclusions are common, but use caution when changing these settings. See the [Microsoft Defender Antivirus documentation] for details.
Other virus scanners have similar exclusion mechanisms. See their respective documentation.
@@ -92,21 +85,20 @@ total count
template
: The path to the template, relative to the `layouts` directory.
[`partial`]: /functions/partials/include/
[`partialCached`]: /functions/partials/includecached/
{{% note %}}
Hugo builds pages in parallel where multiple pages are generated simultaneously. Because of this parallelism, the sum of "cumulative duration" values is usually greater than the actual time it takes to build a site.
{{% /note %}}
> [!note]
> Hugo builds pages in parallel where multiple pages are generated simultaneously. Because of this parallelism, the sum of "cumulative duration" values is usually greater than the actual time it takes to build a site.
## Caching
Some partial templates such as sidebars or menus are executed many times during a site build. Depending on the content within the partial template and the desired output, the template may benefit from caching to reduce the number of executions. The [`partialCached`] template function provides caching capabilities for partial templates.
{{% note %}}
Note that you can create cached variants of each partial by passing additional arguments to `partialCached` beyond the initial context. See the `partialCached` documentation for more details.
{{% /note %}}
> [!note]
> Note that you can create cached variants of each partial by passing additional arguments to `partialCached` beyond the initial context. See the `partialCached` documentation for more details.
## Timers
Use the `debug.Timer` function to determine execution time for a block of code, useful for finding performance bottlenecks in templates. See [details](/functions/debug/timer/).
[`partial`]: /functions/partials/include/
[`partialCached`]: /functions/partials/includecached/
[Microsoft Defender Antivirus documentation]: https://support.microsoft.com/en-us/topic/how-to-add-a-file-type-or-process-exclusion-to-windows-security-e524cbc2-3975-63c2-f9d1-7c2eb5331e53