logoalt Hacker News

Keatstoday at 5:22 PM1 replyview on HN

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?


Replies

minimaxirtoday at 6:05 PM

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.

show 1 reply