Skip to content

v0.4.0

Choose a tag to compare

@MasonLyons MasonLyons released this 18 Oct 00:07
· 10 commits to main since this release
9436c4d

{% blocktranslate %}, {% static %} and humanize's naturaltime now run natively. A full page rendered through the backend with a request (benchmarks/realworld.py: context processors, forms, i18n, static files, humanize) goes from 2.6x to 3.5x faster than stock Django (2.9 ms → 2.2 ms).

pip install -U django-rust-templates

Faster

  • {% blocktranslate %} / {% blocktrans %}: about 6–7x (was 1.1x). Supports count, context, with, trimmed, asvar, plural forms, and the stock fallbacks for missing variables and bad translations.
  • {% static %}: about 10x (was 1.3x). With the default StaticFilesStorage, URLs are memoized per (STATIC_URL, path). Manifest and custom storages still call their own url() every time.
  • humanize naturaltime: about 4.2x (was 1.2x), with output identical in every language Django ships.

Output stays byte-identical to stock Django. Custom tags that override these (a different do_static or handle_simple, for example) keep running their own Python code.