maogou
December 14, 2021, 2:29pm
1
➜ blog git:(develop) hugo server
Start building sites …
hugo v0.90.1+extended darwin/amd64 BuildDate=unknown
| ZH | EN
-------------------±----±-----
Pages | 131 | 132
Paginator pages | 3 | 3
Non-page files | 3 | 3
Static files | 129 | 129
Processed images | 0 | 0
Aliases | 36 | 35
Sitemaps | 2 | 1
Cleaned | 0 | 0
Built in 7717 ms
Watching for changes in /Users/maogou/work/blog/{archetypes,content,static,themes}
Watching for config changes in /Users/maogou/work/blog/config/_default
Environment: “development”
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop
The same blog code compiles very fast on windows 10 OS wls, but compiles very slow on mac os system, please help me
Can you maybe explain, why you think SASS is slowing GoHugo down? Your log does not implicated anything in this direction.
If you have a specific SASS configuration please post that here. In my experience SASS is sometimes slow the first time it runs, then it uses cache files and speeds up immensely.
Also please run the following command and look at the layout-optimisation table that is printed. Oftentimes you can spot “expensive” layouts here that are the reason for slowness.
hugo \
--i18n-warnings \
--templateMetrics \
--templateMetricsHints \
--path-warnings \
--verbose \
--verboseLog
(The important stuff is the templateMetrics part in the command. This will show you what layouts could be cached instead of being loaded every time and it shows how long each template takes to cumulative get built.)
maogou
December 16, 2021, 1:44pm
3
Start building sites …
hugo v0.90.1+extended darwin/amd64 BuildDate=unknown
i18n|MISSING_TRANSLATION|zh|最新文章
i18n|MISSING_TRANSLATION|zh|emoji support
i18n|MISSING_TRANSLATION|zh|markdown syntax guide
i18n|MISSING_TRANSLATION|zh|标准模板
i18n|MISSING_TRANSLATION|zh|math typesetting
i18n|MISSING_TRANSLATION|zh|my four post
i18n|MISSING_TRANSLATION|zh|rich content
i18n|MISSING_TRANSLATION|zh|shortcodes
i18n|MISSING_TRANSLATION|zh|flowchart support
i18n|MISSING_TRANSLATION|zh|chart support
i18n|MISSING_TRANSLATION|zh|syntax highlighting
i18n|MISSING_TRANSLATION|zh|mathjax support
i18n|MISSING_TRANSLATION|zh|katex support
i18n|MISSING_TRANSLATION|zh|js sequence diagram support
i18n|MISSING_TRANSLATION|zh|wavedrom support
i18n|MISSING_TRANSLATION|zh|viz support
i18n|MISSING_TRANSLATION|zh|publications
i18n|MISSING_TRANSLATION|zh|article
i18n|MISSING_TRANSLATION|zh|good title
i18n|MISSING_TRANSLATION|zh|misc
i18n|MISSING_TRANSLATION|zh|book review: duis vulputate
i18n|MISSING_TRANSLATION|zh|copy
i18n|MISSING_TRANSLATION|zh|book
i18n|MISSING_TRANSLATION|zh|donec vel ipsum vulputate, dapibus magna quis
i18n|MISSING_TRANSLATION|zh|showcase overview
i18n|MISSING_TRANSLATION|zh|hugo
i18n|MISSING_TRANSLATION|zh|hugo zzo theme
i18n|MISSING_TRANSLATION|zh|mermaid support
i18n|MISSING_TRANSLATION|zh|hugo zdoc theme
i18n|MISSING_TRANSLATION|zh|presentations
i18n|MISSING_TRANSLATION|zh|diagram
i18n|MISSING_TRANSLATION|zh|syntax
i18n|MISSING_TRANSLATION|zh|math
i18n|MISSING_TRANSLATION|zh|themes
i18n|MISSING_TRANSLATION|zh|themes guide
i18n|MISSING_TRANSLATION|zh|go cron
i18n|MISSING_TRANSLATION|zh|bamoji
i18n|MISSING_TRANSLATION|zh|amoji
i18n|MISSING_TRANSLATION|zh|emoji
i18n|MISSING_TRANSLATION|zh|css
i18n|MISSING_TRANSLATION|zh|gamoji
i18n|MISSING_TRANSLATION|zh|namoji
i18n|MISSING_TRANSLATION|zh|index
i18n|MISSING_TRANSLATION|zh|markdown
i18n|MISSING_TRANSLATION|zh|html
i18n|MISSING_TRANSLATION|zh|shortcode
i18n|MISSING_TRANSLATION|zh|privacy
i18n|MISSING_TRANSLATION|en|posts
i18n|MISSING_TRANSLATION|en|markdown syntax guide
i18n|MISSING_TRANSLATION|en|emoji support
i18n|MISSING_TRANSLATION|en|math typesetting
i18n|MISSING_TRANSLATION|en|rich content
i18n|MISSING_TRANSLATION|en|shortcodes
i18n|MISSING_TRANSLATION|en|chart support
i18n|MISSING_TRANSLATION|en|syntax highlighting
i18n|MISSING_TRANSLATION|en|flowchart support
i18n|MISSING_TRANSLATION|en|katex support
i18n|MISSING_TRANSLATION|en|js sequence diagram support
i18n|MISSING_TRANSLATION|en|mathjax support
i18n|MISSING_TRANSLATION|en|viz support
i18n|MISSING_TRANSLATION|en|wavedrom support
i18n|MISSING_TRANSLATION|en|publications
i18n|MISSING_TRANSLATION|en|article
i18n|MISSING_TRANSLATION|en|good title
i18n|MISSING_TRANSLATION|en|copy
i18n|MISSING_TRANSLATION|en|book
i18n|MISSING_TRANSLATION|en|donec vel ipsum vulputate, dapibus magna quis
i18n|MISSING_TRANSLATION|en|misc
i18n|MISSING_TRANSLATION|en|book review: duis vulputate
i18n|MISSING_TRANSLATION|en|mermaid support
i18n|MISSING_TRANSLATION|en|showcase overview
i18n|MISSING_TRANSLATION|en|hugo
i18n|MISSING_TRANSLATION|en|hugo zdoc theme
i18n|MISSING_TRANSLATION|en|hugo zzo theme
i18n|MISSING_TRANSLATION|en|galleries
i18n|MISSING_TRANSLATION|en|presentations
i18n|MISSING_TRANSLATION|en|diagram
i18n|MISSING_TRANSLATION|en|math
i18n|MISSING_TRANSLATION|en|syntax
i18n|MISSING_TRANSLATION|en|themes
i18n|MISSING_TRANSLATION|en|themes guide
i18n|MISSING_TRANSLATION|en|bamoji
i18n|MISSING_TRANSLATION|en|amoji
i18n|MISSING_TRANSLATION|en|css
i18n|MISSING_TRANSLATION|en|emoji
i18n|MISSING_TRANSLATION|en|gamoji
i18n|MISSING_TRANSLATION|en|html
i18n|MISSING_TRANSLATION|en|privacy
i18n|MISSING_TRANSLATION|en|namoji
i18n|MISSING_TRANSLATION|en|index
i18n|MISSING_TRANSLATION|en|markdown
i18n|MISSING_TRANSLATION|en|shortcode
Template Metrics:
cache cumulative average maximum
potential duration duration duration count template
----- ---------- -------- -------- ----- --------
100 29.879329621s 244.912537ms 7.47588083s 122 partials/head/styles.html
0 24.066003426s 707.82363ms 7.51711195s 34 _default/single.html
0 7.529083099s 3.764541549s 7.503162627s 2 about/single.html
0 1.764721501s 41.040034ms 97.709517ms 43 _default/taxonomy.html
72 918.382568ms 7.527725ms 78.501878ms 122 partials/navbar/site-nav.html
30 538.071351ms 4.13901ms 100.11725ms 130 partials/head/meta_json_ld.html
0 489.455599ms 69.922228ms 101.982791ms 7 _default/list.html
86 388.751806ms 3.18649ms 35.846405ms 122 partials/navbar/nav-menu-mobile.html
35 365.831058ms 7.316621ms 30.542606ms 50 partials/sidebar/sidebar-list.html
0 357.960861ms 89.490215ms 141.401649ms 4 index.html
77 318.34203ms 2.60936ms 60.223059ms 122 partials/footer/site-footer.html
84 304.821568ms 2.498537ms 41.967389ms 122 partials/navbar/nav-menu.html
0 253.340465ms 31.667558ms 64.338953ms 8 publication/list.html
0 244.631634ms 1.839335ms 14.057203ms 133 _default/summary.html
100 201.357589ms 1.548904ms 35.68934ms 130 partials/head/services.html
0 194.034086ms 32.339014ms 53.295705ms 6 _default/terms.html
0 188.597672ms 47.149418ms 72.385007ms 4 showcase/list.html
0 159.420781ms 26.57013ms 34.092157ms 6 publication/single.html
85 148.12937ms 1.214175ms 59.675518ms 122 partials/footer/links-social.html
0 140.753173ms 35.188293ms 68.261314ms 4 archive/list.html
81 117.693262ms 29.423315ms 63.028254ms 4 partials/sidebar/sidebar-home.html
100 115.141018ms 943.778µs 16.555239ms 122 partials/navbar/select-theme-mobile.html
0 110.798428ms 1.582834ms 26.797395ms 70 _default/rss.xml
99 104.694764ms 858.153µs 22.897969ms 122 partials/head/scripts.html
100 95.581665ms 1.77003ms 5.442626ms 54 partials/sidebar/list/posts-by-order.html
99 89.887948ms 736.786µs 24.19782ms 122 partials/search/site-search-mobile.html
44 77.747184ms 584.565µs 6.036714ms 133 partials/summary/classic.html
79 76.999834ms 1.924995ms 25.354945ms 40 partials/body/whoami.html
100 74.762806ms 612.809µs 10.523662ms 122 partials/navbar/select-theme.html
0 66.693793ms 8.336724ms 28.334693ms 8 presentation/single.html
13 65.993821ms 507.644µs 1.68076ms 130 partials/head/meta.html
0 63.568815ms 31.784407ms 35.492858ms 2 gallery/single.html
0 61.510986ms 1.430488ms 3.538689ms 43 _default/taxonomy.searchindex.json
100 52.821462ms 26.410731ms 42.776712ms 2 partials/showcase/show-section.html
96 48.511169ms 898.354µs 2.06951ms 54 partials/taxonomy/taxonomy-tags.html
100 47.162386ms 362.787µs 26.012495ms 130 partials/service/google-analytics.html
100 45.731628ms 11.432907ms 31.558825ms 4 partials/sidebar/site-bio.html
65 37.93446ms 421.494µs 7.773611ms 90 partials/body/breadcrumb.html
75 33.273132ms 616.169µs 22.586795ms 54 partials/taxonomy/taxonomy-series.html
55 32.674046ms 961.001µs 2.28395ms 34 partials/script/single-script.html
100 32.251626ms 264.357µs 6.591568ms 122 partials/navbar/search-icon.html
0 27.204312ms 13.602156ms 17.213171ms 2 404.html
100 27.19802ms 13.59901ms 26.261306ms 2 partials/showcase/show-pinned.html
100 27.091646ms 645.039µs 4.47971ms 42 partials/body/photoswipe.html
100 26.618475ms 218.184µs 6.88868ms 122 partials/footer/go-to-top.html
99 25.727942ms 214.399µs 4.131197ms 120 partials/search/site-search.html
27 25.630004ms 210.082µs 3.749413ms 122 partials/footer/links-feed.html
56 23.196376ms 2.899547ms 16.420691ms 8 partials/script/pt-script.html
67 23.176754ms 681.669µs 4.234311ms 34 partials/pagination/pagination-single.html
0 20.873688ms 1.098615ms 3.501593ms 19 _default/list.searchindex.json
88 20.321772ms 166.571µs 1.354185ms 122 partials/body/main-right.html
95 19.855364ms 367.691µs 1.191554ms 54 partials/taxonomy/taxonomy-categories.html
13 18.71324ms 292.394µs 9.150387ms 64 partials/pagination/pagination.html
100 18.293206ms 457.33µs 3.724534ms 40 partials/comments/comments.html
100 17.436774ms 142.924µs 486.063µs 122 partials/body/main-left.html
100 16.942225ms 313.744µs 6.190332ms 54 partials/search/search-result-desktop.html
68 16.768777ms 419.219µs 2.064854ms 40 partials/body/donation.html
86 15.092605ms 377.315µs 6.472189ms 40 partials/body/share.html
52 13.043313ms 383.626µs 3.959697ms 34 partials/body/infos.html
0 11.860255ms 5.930127ms 6.06048ms 2 _internal/_default/sitemap.xml
96 11.530581ms 94.512µs 6.779092ms 122 partials/header/site-header.html
100 10.594932ms 81.499µs 2.937724ms 130 partials/service/google-tag-manager.html
100 9.545948ms 26.225µs 4.958338ms 364 partials/svgs/etc/search.svg
0 9.091838ms 1.515306ms 2.245023ms 6 _default/terms.searchindex.json
100 9.091193ms 252.533µs 3.996099ms 36 partials/script/clipboard-script.html
100 8.582568ms 35.174µs 5.345288ms 244 partials/svgs/etc/invert-colors.svg
99 6.920539ms 865.067µs 3.92213ms 8 partials/script/pub-list-script.html
100 6.712454ms 51.634µs 516.743µs 130 partials/service/baidu-analytics.html
100 5.586302ms 45.789µs 5.016753ms 122 partials/body/custom-body.html
57 5.537635ms 162.871µs 605.761µs 34 partials/body/related.html
100 5.411185ms 135.279µs 314.931µs 40 partials/comments/utterances.html
100 4.974925ms 2.487462ms 4.811981ms 2 partials/script/about-script.html
98 4.950849ms 29.824µs 1.42182ms 166 partials/svgs/social/email.svg
0 4.70006ms 1.175015ms 3.806262ms 4 shortcodes/expand.html
100 4.375673ms 1.093918ms 4.342534ms 4 partials/svgs/etc/link.svg
84 4.261981ms 1.065495ms 2.69969ms 4 partials/showcase/show-nav.html
100 4.237786ms 78.477µs 654.869µs 54 partials/script/sidebar-script.html
88 4.236382ms 529.547µs 1.255879ms 8 partials/publication/pub-toolbar.html
38 3.978953ms 663.158µs 2.346101ms 6 partials/publication/pub-list.html
72 3.900874ms 325.072µs 1.711689ms 12 partials/publication/pub-meta.html
28 3.847971ms 113.175µs 1.065392ms 34 partials/body/tags.html
57 3.781501ms 630.25µs 910.275µs 6 partials/publication/pub-links.html
99 3.688351ms 21.197µs 1.300077ms 174 partials/svgs/social/github.svg
0 3.67338ms 918.345µs 1.636927ms 4 shortcodes/code.html
24 3.648773ms 202.709µs 453.202µs 18 partials/sidebar/sidebar-single.html
100 3.618594ms 904.648µs 3.615797ms 4 partials/script/archive-script.html
0 3.400501ms 47.894µs 299.154µs 71 _internal/alias.html
100 3.348415ms 418.551µs 1.82173ms 8 partials/svgs/showcase/code.svg
0 3.103677ms 1.551838ms 1.632277ms 2 index.json
0 3.059266ms 764.816µs 1.446138ms 4 _internal/shortcodes/highlight.html
98 2.889846ms 16.419µs 510.933µs 176 partials/svgs/etc/cancel.svg
0 2.530778ms 2.530778ms 2.530778ms 1 sass/main.scss
85 2.505142ms 73.68µs 1.189356ms 34 partials/body/toc.html
100 2.480025ms 27.865µs 372.863µs 89 partials/svgs/etc/rss.svg
100 2.240638ms 560.159µs 2.235695ms 4 partials/sidebar/custom-home.html
100 2.088665ms 17.12µs 727.741µs 122 partials/svgs/arrow/keyboard-arrow-down.svg
99 2.075905ms 1.037952ms 1.623613ms 2 partials/publication/pub-overview.html
100 2.017144ms 67.238µs 1.237023ms 30 partials/svgs/arrow/arrow-forward.svg
100 1.981652ms 15.243µs 305.615µs 130 partials/service/busuanzi.html
100 1.898145ms 15.558µs 508.897µs 122 partials/svgs/arrow/keyboard-arrow-up.svg
100 1.844552ms 461.138µs 1.545928ms 4 partials/script/showcase-script.html
100 1.82115ms 14.927µs 536.902µs 122 partials/footer/select-lang.html
100 1.796611ms 36.665µs 1.746114ms 49 partials/script/taxo-script.html
0 1.73915ms 1.73915ms 1.73915ms 1 _internal/_default/sitemapindex.xml
100 1.477703ms 49.256µs 969.976µs 30 partials/svgs/arrow/arrow-back.svg
100 1.390404ms 11.396µs 503.904µs 122 partials/footer/site-counter.html
100 1.30482ms 32.62µs 704.135µs 40 partials/svgs/donation/alipay.svg
100 1.226378ms 204.396µs 1.221499ms 6 partials/publication/pub-search-result.html
100 1.215624ms 33.767µs 482.376µs 36 partials/script/codeblock-script.html
0 1.129626ms 188.271µs 585.752µs 6 shortcodes/tab.html
100 1.038008ms 173.001µs 653.736µs 6 partials/script/pub-single-script.html
100 927.432µs 463.716µs 840.477µs 2 partials/script/gallery-script.html
0 837.108µs 104.638µs 452.22µs 8 shortcodes/notice.html
100 834.777µs 139.129µs 692.056µs 6 partials/script/home-script.html
100 774.713µs 43.039µs 517.192µs 18 partials/publication/pub-tags.html
100 772.624µs 16.096µs 199.996µs 48 partials/svgs/etc/close.svg
100 763.269µs 190.817µs 733.567µs 4 partials/svgs/etc/location.svg
0 736.181µs 92.022µs 453.355µs 8 shortcodes/alert.html
100 655.087µs 15.597µs 326.108µs 42 partials/svgs/arrow/arrow-right.svg
100 648.535µs 324.267µs 646.523µs 2 partials/script/pub-overview-script.html
100 603.231µs 14.362µs 251.632µs 42 partials/svgs/arrow/arrow-left.svg
100 582.259µs 13.863µs 201.492µs 42 partials/svgs/etc/full-screen.svg
100 572.855µs 11.457µs 522.054µs 50 partials/sidebar/custom-list.html
100 567.906µs 141.976µs 531.518µs 4 partials/svgs/etc/people.svg
100 557.468µs 13.936µs 192.411µs 40 partials/svgs/donation/wechat.svg
100 552.786µs 13.161µs 202.025µs 42 partials/svgs/etc/normal-screen.svg
100 546.483µs 78.069µs 540.822µs 7 partials/script/list-script.html
100 467.753µs 116.938µs 463.604µs 4 partials/header/custom-header.html
0 455.818µs 227.909µs 366.14µs 2 shortcodes/boxmd.html
0 425.331µs 212.665µs 383.364µs 2 shortcodes/tabs.html
0 413.408µs 206.704µs 377.874µs 2 shortcodes/codes.html
100 260.2µs 28.911µs 183.385µs 9 partials/svgs/arrow/keyboard-arrow-right.svg
0 240.365µs 60.091µs 192.897µs 4 shortcodes/box.html
100 191.692µs 1.571µs 83.085µs 122 partials/head/custom-head.html
| ZH | EN
-------------------+-----+------
Pages | 132 | 132
Paginator pages | 3 | 3
Non-page files | 3 | 3
Static files | 129 | 129
Processed images | 0 | 0
Aliases | 36 | 35
Sitemaps | 2 | 1
Cleaned | 0 | 0
WARN 2021/12/16 21:39:32 Duplicate target paths: /Users/maogou/work/blog/public/en/posts/index.html (2), /Users/maogou/work/blog/public/en/showcase/index.html (2), /Users/maogou/work/blog/public/zh/posts/index.html (2), /Users/maogou/work/blog/public/zh/showcase/index.html (2)
Total in 9343 ms
the partials/head/styles.html file content flow
➜ head git:(01f9e43) cat styles.html
{{ $main_options := (dict "targetPath" "css/main.css" "outputStyle" "compressed") }}
{{ $main_template := resources.Get "sass/main.scss" }}
{{ $main_style := $main_template | resources.ExecuteAsTemplate "main_parsed.scss" . | toCSS $main_options | resources.Minify }}
<link rel="stylesheet" href="{{ $main_style.RelPermalink }}">
{{ if .Site.Params.custom_css }}
{{ range .Site.Params.custom_css }}
{{ $custom_template := resources.Get . }}
{{ if $custom_template }}
{{ $custom_style := $custom_template | resources.ToCSS | resources.Minify }}
<link rel="stylesheet" href="{{ $custom_style.RelPermalink }}">
{{ end }}
{{ end }}
{{ end }}%
maogou
December 16, 2021, 1:48pm
4
cache cumulative average maximum
potential duration duration duration count template
----- ---------- -------- -------- ----- --------
100 29.879329621s 244.912537ms 7.47588083s 122 partials/head/styles.html
You are right, that looks optimisable. The meaning is basically that partials/head/styles.html
is 100% cacheable (meaning it’s in 100% of it’s uses the same/identical. Check where the partial is loaded and replace the {{ partial filename . }}
with {{ partialCached filename . }}
. Thats done. You can exchange ALL partial calls that have a 100% in the first column with partialCached. The higher the number is, the higher the possibility to optimise something.
The next files I would check are all of those that need so much time (> 1s). They have a zero cacheablility, but maybe something in the templates needs more time to compute. One really time-intense task is pagination. The more items you have per list page, the less time it needs.
The single.html
might have something strange going on, 34 pages with 24 seconds render time… that’s quite a bit.
1 Like