警告:本文章非专业对比,仅供参考!
本文章会从以下方面对比:
- 安装速度对比
- 新建站点速度对比
- 文章生成速度对比
- 网页生成速度对比
本地预览速度对比 (省流:hugo 比 hexo 快)文档完善程度 (这个不会看,以后再说)
# 测试环境
1 | user@localhost ~> cat /etc/os-release |
注:为保证公平性,默认安装 nodejs 和 npm
hexo 使用的主题: https://github.com/ahonn/hexo-theme-even
hugo 使用的主题: https://github.com/olOwOlo/hugo-theme-even
# 安装速度对比
- hexo
运行脚本:
1 | yarn global add hexo-cli |
输出结果:
1 | user@localhost ~> yarn global add hexo-cli |
- hugo
运行脚本:1
2
3
4
5
6
7
set -e
export A=$(date +%s)
sudo apk add hugo
export B=$(date +%s)
export C=$(expr $B - $A)
echo "$(expr $C / 60)"min"$(expr $C % 60)"s
输出结果:1
2
3
4
5(1/2) Installing hugo (0.120.4-r0)
(2/2) Installing hugo-fish-completion (0.120.4-r0)
Executing busybox-1.36.1-r17.trigger
OK: 192 MiB in 69 packages
0min19s
# 新建站点速度对比
- hexo
运行脚本:1
2
3
4
5
6
7
8
set -e
export A=$(date +%s)
mkdir blog-hexo && cd blog-hexo
hexo init
export B=$(date +%s)
export C=$(expr $B - $A)
echo "$(expr $C / 60)"min"$(expr $C % 60)"s
输出结果:1
2
3
4
5
6
7INFO Cloning hexo-starter https://github.com/hexojs/hexo-starter.git
INFO Install dependencies
warning hexo > warehouse > cuid@2.1.8: Cuid and other k-sortable and non-cryptographic ids (Ulid, ObjectId, KSUID, all UUIDs) are all insecure. Use @paralleldrive/cuid2 instead.
warning hexo-renderer-marked > jsdom > abab@2.0.6: Use your platform's native atob() and btoa() methods instead
warning hexo-renderer-marked > jsdom > data-urls > abab@2.0.6: Use your platform's native atob() and btoa() methods instead
INFO Start blogging with Hexo!
2min6s - hugo
运行脚本:1
2
3
4
5
6
7
set -e
export A=$(date +%s)
hugo new site blog-hugo
export B=$(date +%s)
export C=$(expr $B - $A)
echo "$(expr $C / 60)"min"$(expr $C % 60)"s
输出结果:1
2
3
4
5
6
7
8
9
10
11
12
13
14Congratulations! Your new Hugo site was created in /home/user/blog-hugo.
Just a few more steps...
1. Change the current directory to /home/user/blog-hugo.
2. Create or install a theme:
- Create a new theme with the command "hugo new theme <THEMENAME>"
- Install a theme from https://themes.gohugo.io/
3. Edit hugo.toml, setting the "theme" property to the theme name.
4. Create new content with the command "hugo new content <SECTIONNAME>/<FILENAME>.<FORMAT>".
5. Start the embedded web server with the command "hugo server --buildDrafts".
See documentation at https://gohugo.io/.
0min2s
# 文章生成速度对比
- hexo
运行脚本:1
2
3
4
5
6
7
set -e
export A=$(date +%s)
hexo new test
export B=$(date +%s)
export C=$(expr $B - $A)
echo "$(expr $C / 60)"min"$(expr $C % 60)"s
输出结果:1
2
3INFO Validating config
INFO Created: ~/blog-hexo/source/_posts/test.md
0min21s - hugo
运行脚本:1
2
3
4
5
6
7
set -e
export A=$(date +%s)
hugo new test.md
export B=$(date +%s)
export C=$(expr $B - $A)
echo "$(expr $C / 60)"min"$(expr $C % 60)"s
输出结果:1
2Content "/home/user/blog-hugo/content/test.md" created
0min2s
# 网页生成速度对比
- hexo
运行脚本:1
2
3
4
5
6
7
set -e
export A=$(date +%s)
hexo g
export B=$(date +%s)
export C=$(expr $B - $A)
echo "$(expr $C / 60)"min"$(expr $C % 60)"s
输出结果:1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40INFO Validating config
INFO Start processing
INFO Files loaded in 2.05 s
INFO Generated: archives/1970/index.html
INFO Generated: archives/2023/index.html
INFO Generated: archives/index.html
INFO Generated: archives/1970/01/index.html
INFO Generated: archives/2023/12/index.html
INFO Generated: css/style.scss
INFO Generated: favicon.ico
INFO Generated: robots.txt
INFO Generated: index.html
INFO Generated: lib/fancybox/fancybox_overlay.png
INFO Generated: lib/fancybox/helpers/fancybox_buttons.png
INFO Generated: fonts/chancery/apple-chancery-webfont.svg
INFO Generated: lib/fancybox/fancybox_sprite@2x.png
INFO Generated: lib/fancybox/fancybox_sprite.png
INFO Generated: lib/fancybox/fancybox_loading.gif
INFO Generated: lib/jquery/jquery.min.js
INFO Generated: lib/slideout/slideout.js
INFO Generated: fonts/chancery/apple-chancery-webfont.ttf
INFO Generated: lib/fancybox/blank.gif
INFO Generated: lib/fancybox/jquery.fancybox.js
INFO Generated: lib/fancybox/jquery.fancybox.pack.js
INFO Generated: lib/fancybox/jquery.fancybox.css
INFO Generated: lib/fancybox/helpers/jquery.fancybox-buttons.css
INFO Generated: lib/fancybox/helpers/jquery.fancybox-thumbs.css
INFO Generated: lib/fancybox/helpers/jquery.fancybox-buttons.js
INFO Generated: lib/slideout/slideout.min.js
INFO Generated: lib/fancybox/helpers/jquery.fancybox-media.js
INFO Generated: fonts/chancery/apple-chancery-webfont.woff2
INFO Generated: fonts/chancery/apple-chancery-webfont.eot
INFO Generated: fonts/chancery/apple-chancery-webfont.woff
INFO Generated: lib/fancybox/helpers/jquery.fancybox-thumbs.js
INFO Generated: js/src/even.js
INFO Generated: 1970/01/01/hello-world/index.html
INFO Generated: 2023/12/19/test/index.html
INFO Generated: lib/fancybox/fancybox_loading@2x.gif
INFO 35 files generated in 767 ms
0min23s - hugo
运行脚本:1
2
3
4
5
6
7
set -e
export A=$(date +%s)
hugo
export B=$(date +%s)
export C=$(expr $B - $A)
echo "$(expr $C / 60)"min"$(expr $C % 60)"s
输出结果:1
2
3
4
5
6
7Start building sites …
hugo v0.120.4+extended linux/amd64 BuildDate=unknown
ERROR render of "taxonomy" failed: "/home/user/blog-hugo/themes/even/layouts/_default/baseof.html:14:5": execute of template failed: template: _default/terms.html:14:5: executing "_default/terms.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:79:13: no such template "_internal/google_news.html"
ERROR render of "home" failed: "/home/user/blog-hugo/themes/even/layouts/_default/baseof.html:14:5": execute of template failed: template: index.html:14:5: executing "index.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:79:13: no such template "_internal/google_news.html"
Total in 906 ms
Error: error building site: render: failed to render pages: render of "taxonomy" failed: "/home/user/blog-hugo/themes/even/layouts/_default/baseof.html:14:5": execute of template failed: template: _default/terms.html:14:5: executing "_default/terms.html" at <partial "head.html" .>: error calling partial: execute of template failed: html/template:partials/head.html:79:13: no such template "_internal/google_news.html"难绷,不过 hugo 比 hexo 快
# 附录 1: 测试环境安装 nodejs,npm 和 yarn 的耗时
运行脚本:
1 |
|
输出结果:
1 | (1/11) Installing ca-certificates (20230506-r0) |
# 附录 2:hexo 不用 apk add 安装的原因
1 | user@localhost ~> apk add hexo |
# 附录 3: 文件夹占用大小
- hexo:
1
2
3
4
5
6
755M blog-hexo/node_modules
7.5K blog-hexo/.github
16K blog-hexo/scaffolds
7.5K blog-hexo/source/_posts
11K blog-hexo/source
3.5K blog-hexo/themes
55M blog-hexo/ - hugo:
1
2
3
4
5
6
7
8
97.5K blog-hugo/archetypes
3.5K blog-hugo/assets
3.5K blog-hugo/content
3.5K blog-hugo/data
3.5K blog-hugo/i18n
3.5K blog-hugo/layouts
3.5K blog-hugo/static
3.5K blog-hugo/themes
40K blog-hugo