-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
partialCached slows down Hugo (much) #2935
Comments
But that did not explain issue #2935: ``` BenchmarkPartial-4 200000 6452 ns/op 1040 B/op 30 allocs/op BenchmarkPartialCached-4 500000 4104 ns/op 544 B/op 14 allocs/op BenchmarkPartialCachedVariants-4 500000 3398 ns/op 624 B/op 17 allocs/op ```
I cannot reproduce this on my Mac, which means that it is either
|
(1) That might be, I'm using Windows 7 SP 1 (64bit) with Hugo 64 bit. (2) It's unfortunately not on Github (it's a paid membership kind of site). (Thanks for the quick reply, by the way. And that even during the weekend. :) ) My previous step to reproduce listed above might be incorrect. After I removed all
Now the problem did not happen. Optimistically, I re-introduced my second
And then the problem re-appeared. So I took these steps:
The output for these two steps is:
Here at 8:42:02 I made Some observations:
When I build Hugo to disk (
This error happens with the behaviour described above: creating a cached partial that's referenced in Let me know if I can help by testing out some ideas. |
I can replicate the same issue on another site of mine. If it helps, I can upload a zip file with that site here. (It's on Bitbucket so not publicly browsable.) I'm a little doubtful if I should do that already, because I don't want to give the impression that this issue is very urgent for me (it's not) and I don't want to provide even more stuff to go through. That might be offputting and adding more work then needed. So let me know what would help you best. |
Please do, it is the only (practical) way we can fix this -- this is not at the top of my (or others) list, but the zip file will wait there for someone to pick up. |
Okay, I've uploaded the zip file here: [removed]. To replicate the issue, go to the |
Cached partials that contained cached partials would create a deadlock. Fixes gohugoio#2935
Cached partials that contained cached partials would create a deadlock. Fixes #2935
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
In the footer of each page, I reference the following partial:
That partial contains:
Now when I try to build Hugo (
hugo server --buildDrafts
), it takes a tremendous amount of time before Hugo builds. For instance, here I waited more than 5 minutes and Hugo still hadn't build:Now if I don't use
partialCached
but instead a regular partial:And I don't change anything else in my theme, then the Hugo build time is less than 2 seconds:
I of course referenced the
partialCached
documentation, but I'm not seeing anything in the way that I usepartialCached
to explain this behaviour.To help troubleshoot, the issue also happens when I use:
So it doesn't seem to be caused by using an unique cache key.
That seems to suggest that one of the functions used in the partial don't work nicely with
partialCached
. I tried to rule out that myself, but:shuffle
from the partial had no effect (problem persisted).first 6
from partial had no effect.| shuffle | first 6
) had no effect..Site.Pages
to the new.Site.RegularPages
had no effect.(where .Site.RegularPages "Section" .Section)
with.Site.RegularPages
to rule outwhere
had no effect.To rule out even more, on my pages I used this:
Now when I change that to
partial
(instead ofpartialCached
) and infoot.html
use the following code:Then the same problem happens (Hugo remains stuck on 'Started building sites...'). So it doesn't seem to be caused by a cached partial that references a cached partial.
If you have other ideas I can test, let me know.
The text was updated successfully, but these errors were encountered: