静态站点生成器速度测试(Nikola,Pelican,Hexo,Octopress)

I tested the speed of four static site generators: Nikola, Pelican, Hexo and Octopress, in a clean environment. Spoiler alert: Nikola won.

我在干净的环境中测试了四个静态站点生成器:Nikola,Pelican,Hexo和Octopress的速度。 剧透警报:尼古拉获胜。

Disclaimer: author is a developer and user of Nikola. The test environments used were the same for all four generators.

免责声明:作者是Nikola的开发者和用户。 所有四个发生器使用的测试环境都相同。

发电机经过测试 (Generators tested)

  • Nikola v7.6.1, by Roberto Alsina, Chris Warrick and contributors; Python; MIT license
  • Pelican v3.6.0, by Alexis Metaireau and contributors; Python; GNU AGPL license
  • Hexo v3.1.1, by Tommy Chen and contributors; Node.js; MIT license
  • Octopress v2.0, by Brandon Mathis and contributors; Ruby; MIT license (based on Jekyll)
  • 罗伯托·阿尔西娜(Roberto Alsina),克里斯·沃里克(Chris Warrick)和贡献者的尼古拉 v7.6.1; Python; 麻省理工学院执照
  • Pelican v3.6.0,由Alexis Metaireau和贡献者提供; Python; GNU AGPL许可证
  • Tommy Chen和贡献者提供的Hexo v3.1.1; Node.js; 麻省理工学院执照
  • 布兰登·马西斯(Brandon Mathis)及其贡献者编写的Octopress v2.0; Ruby; MIT许可证(基于Jekyll)

建立 (Setup)

Every site generator was set up in an identical clean environment, using Ubuntu 15.04, x64, as a 512 MB DigitalOcean VM with a 20 GB SSD drive. The machine was updated, an user account with passwordless sudo was created, and build-essential was installed. Tests were run by an automated installer and timer, written in Bash and C, respectively (custom; source code is available). Pre-compiled wheels for lxml and Pillow were used for Nikola testing, because lxml cannot be compiled with less than 1.5 GB of RAM; they were built with pip wheel lxml pillow outside of the testing environment (on a local VM). The machine was reimaged after every test. Lists of installed Python/Ruby/Node packages are available in the GitHub repo (see below).

每个站点生成器都使用Ubuntu 15.04 x64在完全相同的干净环境中设置为带有20 GB SSD驱动器的512 MB DigitalOcean VM。 更新了计算机,创建了具有无密码sudo的用户帐户,并安装了build-essential 。 测试由分别由Bash和C编写的自动安装程序和计时器运行(自定义;源代码可用)。 lxml和Pillow的预编译轮用于Nikola测试,因为lxml的内存不能少于1.5 GB。 它们是在测试环境外部(在本地VM上)使用pip wheel lxml枕头构建的。 每次测试后,机器都会重新成像。 可以在GitHub存储库中找到已安装的Python / Ruby / Node软件包的列表(请参见下文)。

输入项 (Input)

Every site generator was given the same set of 179 log files from #nikola on freenode. The raw logs contain 1209507 bytes (1.1 MiB) of plain text. The logs were processed into post files, which fit the format of each engine (reST or Markdown), containing mandatory metadata, an introductory paragraph and a code block (using :: for reST, four spaces for Markdown). One file had to be altered, because they contained the {{ sequence, which was misinterpreted as internal templating by Hexo and Octopress — it was replaced by a harmless ~~ sequence for all four generators.

每个站点生成器都从freenode上的#nikola获得了相同的179个日志文件集。 原始日志包含1209507字节(1.1 MiB)的纯文本。 日志被处理成适合每个引擎格式的日志文件(reST或Markdown),其中包含强制性元数据,介绍性段落和代码块(对于reST,使用:: ,对于Markdown使用四个空格)。 必须更改一个文件,因为它们包含{{序列,该序列被Hexo和Octopress误解为内部模板—对所有四个生成器都替换为无害的~~序列。

The generators used default config, with one exception: highlighting was disabled for Hexo. The highlighting would cause an unfair advantage (other generators did not automatically highlight the code boxes), and led to very high build times (see table 4 in comparison spreadsheet).

生成器使用默认配置,但有一个例外:Hexo的突出显示被禁用。 突出显示会带来不公平的优势(其他生成器不会自动突出显示代码框),并导致非常长的构建时间(请参阅比较电子表格中的表4)。

建立 (Build)

Sites were built a total of 110 times, in 10 cycles of 11 builds each. The first build of a cycle was a fresh build, the remaining 10 were rebuilds. Sites and cache files were removed after each cycle.

站点共构建了110次,每10个周期进行11个构建。 一个周期的第一个构建是新构建,其余10个是重建。 站点和缓存文件在每个周期后被删除。

结果 (Results)

Because Nikola and Hexo use incremental rebuilds, the results were compared in two groups: 11 and 10 runs.

由于Nikola和Hexo使用增量重建,因此将结果分为两组:11和10次运行。

平均构建时间(以秒为单位) (Average build times (in seconds))

#Generator 发电机 Average of 11 runs 平均11次 Average of 10 runs 平均10次
1 1个 Nikola 尼古拉 2.38290 2.38290 2.06057 2.06057
2 2 Pelican2.61924 2.61924 2.62352 2.62352
3 3 Hexo 六o 6.27361 6.27361 6.21267 6.21267
4 4 Octopress Octopress 9.57618 9.57618 9.47550 9.47550

完整结果 (Full results)

Full results are available in ods format.

完整结果以ods格式提供

原始结果和配置 (Raw results and configuration)

Raw results (.csv files from the test runner) and configuration is available in the GitHub repo. Log files and converted posts are not available publicly; however, they can be provided to interested parties (contact me to obtain them).

原始结果(来自测试运行程序的.csv文件)和配置在GitHub repo中提供 。 日志文件和转换后的帖子无法公开获得; 但是,可以将它们提供给感兴趣的各方( 与我联系以获得它们)。

问题和解答 (Questions and answers)

为什么不平原杰基尔? (Why not plain Jekyll?)

Plain Jekyll was disqualified on the basis of missing many features other generators have, leading to an unfair advantage. The aim of this test was to provide similar setups for each of the four generators. Jekyll generates a very basic site that lacks some elements; a Jekyll site does not have paginated indexes, (partial) post text on indexes, any sort of archives, etc. A Jekyll site contains only one CSS file, index.html, feed.xml, and the log posts. On the other hand, sites generated by Pelican, Nikola and Hexo contain more files, which makes the builds longer and the website experience richer (archives, JS, sitemaps, tag listings).

Plain Jekyll因缺少其他生成器具有的许多功能而被取消参赛资格 ,从而导致了不公平的优势。 该测试的目的是为四个发生器中的每个发生器提供相似的设置。 Jekyll生成了一个非常基本的网站,缺少一些元素。 Jekyll网站没有分页索引,索引的(部分)帖子文本,任何类型的存档等。Jekyll网站仅包含一个CSS文件,index.html,feed.xml和日志帖子。 另一方面,由Pelican,Nikola和Hexo生成的网站包含更多文件,这使构建时间更长并且网站体验更丰富(存档,JS,站点地图,标签列表)。

On the basis of the above, Octopress was chosen to represent the Jekyll universe at large. Octopress sites have more assets, a sitemap, archives and category listings — making it comparable to the other four contenders. However, tests were performed for Jekyll. The average result from 11 builds was 2.22118, while the average result from 10 builds was 2.23903. The result would land Jekyll on the 1st place for 11 builds, and on the 2nd place for 10 builds.

基于以上所述,选择了Octopress来代表整个Jekyll宇宙。 Octopress网站拥有更多资产,站点地图,档案和类别​​列表,使其可与其他四个竞争者相提并论。 但是,对Jekyll进行了测试。 11个构建的平均结果为2.22118,而10个构建的平均结果为2.23903。 结果会使Jekyll排名第一,获得11个版本,排名第二的位置,获得10个版本。

为什么不使用$ MYFAVORITESSG? (Why not $MYFAVORITESSG?)

I tested only four popular generators that were easy enough to set up. I could easily extend the set if I had time and friendly enough documentation to do so. I can add a SSG, provided that:

我只测试了四个易于设置的流行生成器。 如果我有足够的时间和足够友好的文档,可以轻松地扩展集合。 我可以添加一个SSG,条件是:

  • it’s easy to configure
  • it has a default config that provides a working site with a feature set comparable to other SSGs tested here (see Why not plain Jekyll?)

翻译自: https://www.pybloggers.com/2015/07/static-site-generator-speed-test-nikola-pelican-hexo-octopress/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值