← Back to context

Comment by Keats

5 hours ago

As the author of Tera mentioned in the article, I am curious how it can get 2x faster. Was the benchmark using tera v2 with the `fast` feature enabled?

They were with tera 2.1.0, however using the default settings and not enabling the `fast` feature (which I did not know about, TIL).

The comparison benchmark results in the post were older and prior to further passes. After updating to tera 2.4.0 and enabling the `fast` feature set, I reran the benchmarks against the current codebase and the difference between my Rust crate and Tera is now about ~1.5x.

Some of the technical differences are (which in disclosure were surfaced by GPT 5.6 Sol): context and loop values are borrowed while Tera clones, cached static positions/lookups, less per-render heap setup, escaping chunks directly into the final String instead of bytes, and more granular bytecode functions which avoid stacks.

  • Full type checking like in Askama and hot reloading of templates would be a great combination. Is that a feasible path with your project?