Hugo building slowly from release 0.128.0

We have a very large site and have recently gone through the process of upgrading the Hugo version we are using from 0.126.1 to 0.156.0.

We found that our build jobs went from taking around 10 minutes to over 16 minutes. This extra time came mainly from the Hugo build step which went from 240077ms to 601931ms, 361854ms longer (6’02" matching the extended time). We see the same duration in 0.163.3

Research into different versions of Hugo showed that this difference in time was introduced in 0.128.0 - see information below. Although the debug output from the build does not show this precisely, the main change in this version was to Implement defer · gohugoio/hugo@6cd0784 · GitHub . However, we do not use anything that uses defer (“INFO build: step render deferred count 0 duration 3.638µs”) so perhaps it is something else? I notice that the documentation specifically says that defer is a rare requirement (“In some rare use cases, you may need to defer the execution of a template until after all sites and output formats have been rendered.” ( templates.Defer )).

Is there anything we can change in our site to go back to our original build times?

If this is a known issue, is there a workaround, or a plan to speed up the builds to their original speed?

This speed change is so big I have looked through the issues in GitHub and on this site, but can’t find anyone else who is getting it. We are probably getting this because of the number and size of our pages pages, including the size of the navigation that Docsy is creating for us, but we do not want to lose the flexibility that our implementation is giving us.

Debug Reports from various versions

Hugo 0.126.1

Wed Jul 1 01:43:35 PM UTC 2026

Start building sites …

hugo v0.126.1-3d40aba512931031921463dafc172c0d124437b8+extended linux/amd64 BuildDate=2024-05-15T10:42:34Z VendorInfo=gohugoio

INFO static: syncing static files to / duration 4.755879118s

INFO build: step process substep collect files 1000 files_total 1000 pages_total 975 resources_total 25 duration 6.098291133s

INFO build: step process substep collect files 3331 files_total 4331 pages_total 4281 resources_total 50 duration 347.983344ms

INFO build: step process duration 6.446386864s

INFO build: step assemble duration 202.454003ms

INFO build: step render substep pages site en outputFormat html duration 3m51.199674823s

INFO build: step render substep pages site en outputFormat print duration 5.664918331s

INFO build: step render substep pages site en outputFormat rss duration 262.442949ms

INFO build: step render pages 8567 content 4282 duration 3m57.140850325s

INFO build: step postProcess duration 27.785µs

INFO build: duration 4m3.789917846s

| EN

-------------------±-------

Pages | 8567

Paginator pages | 0

Non-page files | 50

Static files | 14326

Processed images | 0

Aliases | 2934

Cleaned | 0

Total in 243822 ms

Wed Jul 1 01:47:39 PM UTC 2026

Hugo 0.127.0

Wed Jul 1 01:58:55 PM UTC 2026

Start building sites …

hugo v0.127.0-74e0f3bd63c51f3c7a0f07a7c779eec9e922957e+extended linux/amd64 BuildDate=2024-06-05T10:27:59Z VendorInfo=gohugoio

INFO static: syncing static files to / duration 4.927688375s

INFO build: step process substep collect files 1000 files_total 1000 pages_total 975 resources_total 25 duration 5.912736661s

INFO build: step process substep collect files 3331 files_total 4331 pages_total 4281 resources_total 50 duration 340.666742ms

INFO build: step process duration 6.258541873s

INFO build: step assemble duration 199.482989ms

INFO build: step render substep pages site en outputFormat html duration 3m48.065088826s

INFO build: step render substep pages site en outputFormat print duration 5.138489695s

INFO build: step render substep pages site en outputFormat rss duration 368.986436ms

INFO build: step render pages 8567 content 4282 duration 3m53.585819071s

INFO build: step postProcess duration 25.256µs

INFO build: duration 4m0.045148895s

| EN

-------------------±-------

Pages | 8567

Paginator pages | 0

Non-page files | 50

Static files | 14326

Processed images | 0

Aliases | 2934

Cleaned | 0

Total in 240077 ms

Wed Jul 1 02:02:56 PM UTC 2026

Hugo 0.128.2

Wed Jul 1 02:09:39 PM UTC 2026

Start building sites …

hugo v0.128.2-de36c1a95d28595d8243fd8b891665b069ed0850+extended linux/amd64 BuildDate=2024-07-04T08:13:25Z VendorInfo=gohugoio

INFO static: syncing static files to / duration 4.925005792s

INFO build: step process substep collect files 1000 files_total 1000 pages_total 975 resources_total 25 duration 6.128539854s

INFO build: step process substep collect files 3331 files_total 4331 pages_total 4281 resources_total 50 duration 352.124974ms

INFO build: step process duration 6.491096625s

INFO build: step assemble duration 228.251498ms

INFO build: step render substep pages site en outputFormat html duration 9m44.482978732s

INFO build: step render substep pages site en outputFormat print duration 10.330178566s

INFO build: step render substep pages site en outputFormat rss duration 359.552672ms

INFO build: step render pages 8567 content 4282 duration 9m55.181953772s

INFO build: step render deferred count 0 duration 3.638µs

INFO build: step postProcess duration 21.203µs

INFO build: duration 10m1.901556268s

| EN

-------------------±-------

Pages | 8567

Paginator pages | 0

Non-page files | 50

Static files | 14326

Processed images | 0

Aliases | 2934

Cleaned | 0

Total in 601931 ms

Wed Jul 1 02:19:41 PM UTC 2026

Hugo 0.163.3

Thu Jul 2 08:11:02 AM UTC 2026

INFO deprecated: project config key imaging.quality was deprecated in Hugo v0.163.0 and will be removed in a future release. Set the quality per format instead with imaging.jpeg.quality, imaging.webp.quality and/or imaging.avif.quality.

WARN deprecated: project config key languageCode was deprecated in Hugo v0.158.0 and will be removed in a future release. Use locale instead.

WARN deprecated: project config key languages.en.languageName was deprecated in Hugo v0.158.0 and will be removed in a future release. Use languages.en.label instead.

INFO deprecated: project config key imaging.quality was deprecated in Hugo v0.163.0 and will be removed in a future release. Set the quality per format instead with imaging.jpeg.quality, imaging.webp.quality and/or imaging.avif.quality.

Start building sites …

hugo v0.163.3-4d22555aebf458d5d150500c9ac4bee5b24cf0d3+extended linux/amd64 BuildDate=2026-06-18T16:18:24Z VendorInfo=gohugoio

INFO build: step process substep collect files 4338 files_total 4338 pagesources_total 4288 resourcesources_total 50 duration 188.951417ms

INFO build: step process duration 189.146309ms

INFO static: syncing static files to / duration 4.994994616s

INFO build: step assemble duration 7.119902831s

WARN deprecated: .Language.LanguageDirection was deprecated in Hugo v0.158.0 and will be removed in a future release. Use .Language.Direction instead.

INFO build: step render substep pages site en outputFormat html duration 9m27.28409594s

INFO build: step render substep pages site en outputFormat print duration 14.137290933s

INFO build: step render substep pages site en outputFormat rss duration 4.225965198s

INFO build: step render pages 8581 content 6810 duration 9m45.666412073s

INFO build: step render deferred count 0 duration 2.677µs

INFO build: step postProcess duration 27.083µs

INFO build: duration 9m52.975867582s

              │  EN   

──────────────────┼───────

Pages │ 8581

Paginator pages │ 0

Non-page files │ 50

Static files │ 14332

Processed images │ 0

Aliases │ 1467

Cleaned │ 0

Total in 593128 ms

Thu Jul 2 08:20:55 AM UTC 2026

Can you please share your project repository?

The repo is GitHub - mendix/docs: Mendix documentation repository · GitHub

It publishes to https://docs.mendix.com/

(Sorry I didn’t include these earlier).

Can you explain how to set this up? I’ve cloned the repo and run npm i, then when I try to build with v0.128.0:

WARN  Module "docsy" is not compatible with this Hugo version: Min 0.146.0 extended; run "hugo mod graph" for more information.
Start building sites … 
hugo v0.128.0-e6d2712ee062321dc2fc49e963597dd5a6157660+extended linux/amd64 BuildDate=2024-06-25T16:15:48Z VendorInfo=gohugoio

Total in 22 ms
Error: error building site: "/home/jmooring/temp/docs/node_modules/docsy/layouts/_partials/scripts/katex.html:7:1": parse failed: template: _partials/scripts/katex.html:7: function "try" not defined

Then I tried to build wiht the minimum required version (v0.146.0):

Start building sites … 
hugo v0.146.0-5d1b9d39858bb0b2e505af9f649bfb55295ecca1+extended linux/amd64 BuildDate=2025-04-10T14:57:56Z VendorInfo=gohugoio

Total in 186 ms
Error: error building site: "/home/jmooring/temp/docs/node_modules/docsy/i18n/en.yaml:1:1": failed to load translations: unsupported file format bool

There are instructions in the README here: GitHub - mendix/docs: Mendix documentation repository · GitHub but that won’t help you run 0.126.0.

You will need to clone the repo from commit d05683d4eb5c034bfbb19167fe9384973a111e2c to get the version before we upgraded Hugo and Docsy when you should be able to build it and bump the Hugo versions.

Hope that works for you. Thanks for looking into this.

Can you reproduce the problem with the latest version of Hugo combined with the latest version of Docsy? I would not like to spend time testing the wrong things.

hugo
WARN  deprecated: project config key languageCode was deprecated in Hugo v0.158.0 and will be removed in a future release. Use locale instead.
WARN  deprecated: project config key languages.en.languageName was deprecated in Hugo v0.158.0 and will be removed in a future release. Use languages.en.label instead.
WARN  module with path "." is imported for the same version "" more than once; this is currently only allowed in the main project's config.
Start building sites … 
hugo v0.164.0-DEV-128fb17c2b1fd29bbfbce868af1813ad35d31b2a+withdeploy linux/amd64 BuildDate=2026-06-28T13:37:21Z VendorInfo=jmooring

Total in 3649 ms
ERROR error building site: assemble: failed to create page from pageMetaSource /docs/refguide/modeling/integration/rest-services/consumed-rest-services/use-call-rest-action-in-microflow: "/home/jmooring/temp/docs/content/en/docs/refguide/modeling/integration/rest-services/consumed-rest-services/use-call-rest-action-in-microflow.md:6:1": [5:1] mapping key "description" already defined at [4:1]
   2 | url: /refguide/integration/use-call-rest-action-in-microflow/
   3 | weight: 15
   4 | description: "Describes how to integrate an existing system or a legacy system into a Mendix app by calling a REST service in a microflow."
>  5 | description: "Describes how to get information from a REST service."
       ^
   6 | aliases:
   7 |     - /howto/integration/consume-a-rest-service/
jmooring@ubuntu:~/temp/docs ((HEAD detached at d05683d4eb))$ 

Yes, it still takes a long time (600000ms) using 0.163.3.

You should be able to build the latest commit using 0.164.0 but you can’t build the commit I gave you with 0.164.0 because there were various additional constraints and we corrected some errors which the later version of Hugo was finding.

On 0.126.0 we were getting it built in 250000ms or so.

It is only the timing which is an issue. The site that is built in both 0.126.0 and 0.163.0 both work (once the additional edits to correct the errors have been done).

There are two branches on our site which I have been using for testing.

GitHub - mendix/docs at MvM-HugoTests156 · GitHub works for the latest Hugo version.

GitHub - mendix/docs at MvM-HugoTests · GitHub works for versions around 0.127.0/0.128.0 which is where the slowdown appeared.

Unfortunately the changes in Hugo and Docsy mean that you can’t just bump Hugo from 126 to 164 on a single branch.

I’ll look at this again later when I have more time, but I strongly encourage you to get to the point where you can test the latest version of Hugo with the latest version of Docsy with the latest version of your project.

jmooring@ubuntu:~/temp/docs (MvM-HugoTests156)$ hugo


WARN  deprecated: project config key languageCode was deprecated in Hugo v0.158.0 and will be removed in a future release. Use locale instead.
WARN  deprecated: project config key languages.en.languageName was deprecated in Hugo v0.158.0 and will be removed in a future release. Use languages.en.label instead.
Start building sites … 
hugo v0.163.3-4d22555aebf458d5d150500c9ac4bee5b24cf0d3+extended linux/amd64 BuildDate=2026-06-18T16:18:24Z VendorInfo=gohugoio

WARN  deprecated: .Language.LanguageDirection was deprecated in Hugo v0.158.0 and will be removed in a future release. Use .Language.Direction instead.
WARN  Algolia being generated

                  │  EN   
──────────────────┼───────
 Pages            │  8560 
 Paginator pages  │     0 
 Non-page files   │    50 
 Static files     │ 14326 
 Processed images │     0 
 Aliases          │  1467 
 Cleaned          │     0 

Total in 131183 ms

If you take our development branch and bump Hugo to 0.163.3 then it runs (with some deprecation warnings). What you can’t do is go back to before 0.128.0 to see that the same site is built in less than half the time.

My original post has the output from a build of 0.163.3. It builds the same site as 0.126.0 but the render to html takes 9m27 instead of 3m51, with the other render steps also taking longer.

Unfortunately, the debug output doesn’t give any more information than that.

Let me know if there is anything else I can give you.

Thanks for looking into this for me, sorry you were having issues getting the site built.

Hugo 0.163.3

Thu Jul 2 08:11:02 AM UTC 2026

INFO deprecated: project config key imaging.quality was deprecated in Hugo v0.163.0 and will be removed in a future release. Set the quality per format instead with imaging.jpeg.quality, imaging.webp.quality and/or imaging.avif.quality.

WARN deprecated: project config key languageCode was deprecated in Hugo v0.158.0 and will be removed in a future release. Use locale instead.

WARN deprecated: project config key languages.en.languageName was deprecated in Hugo v0.158.0 and will be removed in a future release. Use languages.en.label instead.

INFO deprecated: project config key imaging.quality was deprecated in Hugo v0.163.0 and will be removed in a future release. Set the quality per format instead with imaging.jpeg.quality, imaging.webp.quality and/or imaging.avif.quality.

Start building sites …

hugo v0.163.3-4d22555aebf458d5d150500c9ac4bee5b24cf0d3+extended linux/amd64 BuildDate=2026-06-18T16:18:24Z VendorInfo=gohugoio

INFO build: step process substep collect files 4338 files_total 4338 pagesources_total 4288 resourcesources_total 50 duration 188.951417ms

INFO build: step process duration 189.146309ms

INFO static: syncing static files to / duration 4.994994616s

INFO build: step assemble duration 7.119902831s

WARN deprecated: .Language.LanguageDirection was deprecated in Hugo v0.158.0 and will be removed in a future release. Use .Language.Direction instead.

INFO build: step render substep pages site en outputFormat html duration 9m27.28409594s

INFO build: step render substep pages site en outputFormat print duration 14.137290933s

INFO build: step render substep pages site en outputFormat rss duration 4.225965198s

INFO build: step render pages 8581 content 6810 duration 9m45.666412073s

INFO build: step render deferred count 0 duration 2.677µs

INFO build: step postProcess duration 27.083µs

INFO build: duration 9m52.975867582s

              │  EN   

──────────────────┼───────

Pages │ 8581

Paginator pages │ 0

Non-page files │ 50

Static files │ 14332

Processed images │ 0

Aliases │ 1467

Cleaned │ 0

Total in 593128 ms

Thu Jul 2 08:20:55 AM UTC 2026

Then why does it build for me in only 2 min?

Can’t answer that. I get the same issue building in Windows and on our Linux CI/CD stack.

Could I be hitting a memory issue?

I’ll try running it with --printMemoryUsage and see what I get. Thanks for the pointer.

With Windows:
https://gohugo.io/troubleshooting/performance/#virus-scanning

Though I don’t see how that would be a factor presuming you are running your comparisons on the same Windows machine.

We see the same slower performance on our linux CI/CD stack (which is where the figures I’ve been quoting come from, since that is the important time for us, rather than local build).

I’m running the test with --printMemoryUsage to see if that gives more information.

Thanks for helping me look into this