aboutsummaryrefslogtreecommitdiffhomepage
path: root/docs/content/en/troubleshooting/performance.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/content/en/troubleshooting/performance.md')
-rw-r--r--docs/content/en/troubleshooting/performance.md26
1 files changed, 22 insertions, 4 deletions
diff --git a/docs/content/en/troubleshooting/performance.md b/docs/content/en/troubleshooting/performance.md
index 174d6cfd9..a2df1b08e 100644
--- a/docs/content/en/troubleshooting/performance.md
+++ b/docs/content/en/troubleshooting/performance.md
@@ -1,6 +1,6 @@
---
title: Performance
-description: Use template metrics and timers to identify opportunities to improve performance.
+description: Tools and suggestions for evaluating and improving performance.
categories: [troubleshooting]
keywords: []
menu:
@@ -12,6 +12,24 @@ toc: true
aliases: [/troubleshooting/build-performance/]
---
+## Virus scanning
+
+Virus scanners are an essential component of system protection, but the performance impact can be severe for applications like Hugo that frequently read and write to disk. For example, with Microsoft Defender Antivirus, build times for some sites may increase by 400% or more.
+
+Before building a site, your virus scanner has already evaluated the files in your project directory. Scanning them again while building the site is superfluous. To improve performance, add Hugo's executable to your virus scanner's process exclusion list.
+
+For example, with Microsoft Defender Antivirus:
+
+**Start** > **Settings** > **Privacy & security** > **Windows Security** > **Open Windows Security** > **Virus & threat protection** > **Manage settings** > **Add or remove exclusions** > **Add an exclusion** > **Process**
+
+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 %}}
+
+Other virus scanners have similar exclusion mechanisms. See their respective documentation.
+
## Template metrics
Hugo is fast, but inefficient templates impede performance. Enable template metrics to determine which templates take the most time, and to identify caching opportunities:
@@ -74,8 +92,8 @@ total count
template
: The path to the template, relative to the layouts directory.
-[`partial`]: /functions/partials/include
-[`partialCached`]: /functions/partials/includecached
+[`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.
@@ -86,7 +104,7 @@ Hugo builds pages in parallel where multiple pages are generated simultaneously.
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 parameters to `partialCached` beyond the initial context. See the `partialCached` documentation for more details.
+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 %}}
## Timers