machinetranslate/machinetranslate.org

Bug: Build time is too long

Closed this issue · 4 comments

On GitHub CI it is taking 20 minutes, and similarly for me locally (ThinkPad, Ubuntu).

There are some obvious performance bottlenecks, for example in language.html:

{% assign language = false %}
{% for lang in site.data.languages %}
  {% if lang.codes.first == page.code %}
    {% assign language = lang %}
  {% endif %}
{% endfor %}

So for every language, we're looping over all languages.

In general, we should try to move more out of Liquid layout templates and into generate.py.

Let's leave this open, because it's still needs to get even faster.

Right now it's mainly the render loop.

We could try to parellelize with YJIT - https://talk.jekyllrb.com/t/psa-faster-builds-with-yjit/7853 - but it requires Ruby 3.1.

One more idea to make the build faster:

In generate.py we could generate .html, not .md, and potentially even avoid using any Liquid.

So basically those pages would not even need to go through Jekyll/Liquid rendering, because we'd be rendering ourselves.

Adam

According to just-the-docs/just-the-docs#863, there was a speedup in v0.4.0.

It looks like we have frozen the version of Just The Docs, maybe we should upgrade it?
_config.yml

# Just the Docs
--
165 | remote_theme: pmarsceill/just-the-docs@v0.3.3
166 | logo: favicon.ico
167 | color_scheme: swissred
168 | search:

</div></div></div></div></div></div><br class="Apple-interchange-newline">

Update: This did not help, the build still takes about 30 minutes.