Skip to content

v0.3.1

Choose a tag to compare

@MasonLyons MasonLyons released this 17 Oct 21:34
· 20 commits to main since this release
1a31304

Faster {% if %} comparisons against integer literals: {% if n > 90 %} inside a loop now renders about 2x faster (96 → 49 µs on the if_branch benchmark), moving it from 0.56x to ~1.1x of Jinja2, the only scenario where Jinja2 had been ahead.

pip install -U django-rust-templates

Faster

  • {% if var OP <int> %} (==, !=, <, <=, >, >=) on a plain integer compares natively. Bools, floats, strings, int subclasses, missing variables, callables and out-of-range ints take the unchanged general path, so output is identical.
  • {% if %} writes the chosen branch straight into the page output instead of through a temporary buffer.