Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pagniation.pagerSize has bad performance #13078

Open
sgraband opened this issue Nov 21, 2024 · 3 comments
Open

pagniation.pagerSize has bad performance #13078

sgraband opened this issue Nov 21, 2024 · 3 comments

Comments

@sgraband
Copy link

I updated the hugo version for our website to 0.139.0 lately. The build now gives this warning:

WARN deprecated: site config key paginate was deprecated in Hugo v0.128.0 and will be removed in a future release. Use pagination.pagerSize instead.

Therfore i changed the entry in the config.toml from

paginate = "6"

to

[pagination]
pagerSize = "6"

While this works it increases the build time of the website by a factor of 10 (from 1 minute to 10 minutes).
Is there a reason why the build time increases that drastically? Or is there a better way to remove the deprecated field and still have the normal performance?

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.139.0-dacef0df92a9a20072b4eaa42003e1a63ace8f41+extended linux/amd64 BuildDate=2024-11-18T16:17:45Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

yes

@bep
Copy link
Member

bep commented Nov 21, 2024

While this works it increases the build time of the website by a factor of 10 (from 1 minute to 10 minutes).

This doesn't make sense that moving a config option should slow down the build, so there must be something else in play, which is impossible to tell without seeing the site source.

@jmooring
Copy link
Member

This doesn't make sense

Agreed. Just tested with a 10,000 page size. No difference.

@sgraband
Copy link
Author

Thank you for the fast response!
Yes it is indeed strange, however i retested it once again. I build the site with paginate and it takes 70586 ms. Then i clean the repository and rebuild it with pagination.pagerSize and the build takes 747651 ms.

I actually spotted an additional oddity, which might give some insight into what happens. The number of paginator pages actually increases from 448 to 71680, which explains the longer build time, but i do not understand where the additional pages come from.

Our usage of the paginator is basically this code here:

      {{ $p := where site.AllPages "Section" "in" site.Params.mainSections }}
      {{ $paginator := .Paginate (where $p "Title" "!=" "EclipseSource Blogs") }}
      {{ range $paginator.Pages }}

Any ideas or pointers on where this could come from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants