An open API service indexing awesome lists of open source software.

https://github.com/askama-rs/template-benchmark

Comparison of template engines written in and for Rust.
https://github.com/askama-rs/template-benchmark

benchmark comparison html rust template-engine templates

Last synced: 9 months ago
JSON representation

Comparison of template engines written in and for Rust.

Awesome Lists containing this project

README

          

# Rust Template Benchmark

This benchmark tries to compare different template engines in Rust.
We consider both precompiled and dynamic engines, which of course have wildly different runtime
performances.

**Beware:** One engine might be faster than the other.
But if the other engine is more ergonomical to work with,
e.g. because you have no re-compilation times, then it might still be the better fit for you.
Only you can decide which characteristics of a template engine
(runtime speed, simplicity of programming, …) are important to you.

Currently, we compare 17 different template engines.
All of them are well maintained, mature and perform HTML escaping automatically.

| Crate | Docs | Repo | Code | Recent
Downloads | Github
Stars | Contrib-
utors | Recent
Commits |
| -------------- | ----------------------------------------------- | ---------------------------------- | -------------| ------------------------------------ | -------------------------------------------- | -------------------------------------------- | ------------------------------------------ |
| [askama] | [![][docs-img-askama]][docs-askama] | [![][img-repo]][repo-askama] | pre-compiled | [![][dl-askama]][askama] | [![][stars-askama]][repo-askama] | [![][contr-askama]][repo-askama] | [![][act-askama]][repo-askama] |
| [dioxus] | [![][docs-img-dioxus]][docs-dioxus] | [![][img-repo]][repo-dioxus] | ssr | [![][dl-dioxus]][dioxus] | [![][stars-dioxus]][repo-dioxus] | [![][contr-dioxus]][repo-dioxus] | [![][act-dioxus]][repo-dioxus] |
| [handlebars] | [![][docs-img-handlebars]][docs-handlebars] | [![][img-repo]][repo-handlebars] | interpreted | [![][dl-handlebars]][handlebars] | [![][stars-handlebars]][repo-handlebars] | [![][contr-handlebars]][repo-handlebars] | [![][act-handlebars]][repo-handlebars] |
| [horrorshow] | [![][docs-img-horrorshow]][docs-horrorshow] | [![][img-repo]][repo-horrorshow] | pre-compiled | [![][dl-horrorshow]][horrorshow] | [![][stars-horrorshow]][repo-horrorshow] | [![][contr-horrorshow]][repo-horrorshow] | [![][act-horrorshow]][repo-horrorshow] |
| [hypertext] | [![][docs-img-hypertext]][docs-hypertext] | [![][img-repo]][repo-hypertext] | pre-compiled | [![][dl-hypertext]][hypertext] | [![][stars-hypertext]][repo-hypertext] | [![][contr-hypertext]][repo-hypertext] | [![][act-hypertext]][repo-hypertext] |
| [leptos] | [![][docs-img-leptos]][docs-leptos] | [![][img-repo]][repo-leptos] | ssr | [![][dl-leptos]][leptos] | [![][stars-leptos]][repo-leptos] | [![][contr-leptos]][repo-leptos] | [![][act-leptos]][repo-leptos] |
| [liquid] | [![][docs-img-liquid]][docs-liquid] | [![][img-repo]][repo-liquid] | interpreted | [![][dl-liquid]][liquid] | [![][stars-liquid]][repo-liquid] | [![][contr-liquid]][repo-liquid] | [![][act-liquid]][repo-liquid] |
| [markup] | [![][docs-img-markup]][docs-markup] | [![][img-repo]][repo-markup] | pre-compiled | [![][dl-markup]][markup] | [![][stars-markup]][repo-markup] | [![][contr-markup]][repo-markup] | [![][act-markup]][repo-markup] |
| [maud] | [![][docs-img-maud]][docs-maud] | [![][img-repo]][repo-maud] | pre-compiled | [![][dl-maud]][maud] | [![][stars-maud]][repo-maud] | [![][contr-maud]][repo-maud] | [![][act-maud]][repo-maud] |
| [minijinja] | [![][docs-img-minijinja]][docs-minijinja] | [![][img-repo]][repo-minijinja] | interpreted | [![][dl-minijinja]][minijinja] | [![][stars-minijinja]][repo-minijinja] | [![][contr-minijinja]][repo-minijinja] | [![][act-minijinja]][repo-minijinja] |
| [ructe] | [![][docs-img-ructe]][docs-ructe] | [![][img-repo]][repo-ructe] | pre-compiled | [![][dl-ructe]][ructe] | [![][stars-ructe]][repo-ructe] | [![][contr-ructe]][repo-ructe] | [![][act-ructe]][repo-ructe] |
| [sailfish] | [![][docs-img-sailfish]][docs-sailfish] | [![][img-repo]][repo-sailfish] | pre-compiled | [![][dl-sailfish]][sailfish] | [![][stars-sailfish]][repo-sailfish] | [![][contr-sailfish]][repo-sailfish] | [![][act-sailfish]][repo-sailfish] |
| [sycamore] | [![][docs-img-sycamore]][docs-sycamore] | [![][img-repo]][repo-sycamore] | ssr | [![][dl-sycamore]][sycamore] | [![][stars-sycamore]][repo-sycamore] | [![][contr-sycamore]][repo-sycamore] | [![][act-sycamore]][repo-sycamore] |
| [tera] | [![][docs-img-tera]][docs-tera] | [![][img-repo]][repo-tera] | interpreted | [![][dl-tera]][tera] | [![][stars-tera]][repo-tera] | [![][contr-tera]][repo-tera] | [![][act-tera]][repo-tera] |
| [tinytemplate] | [![][docs-img-tinytemplate]][docs-tinytemplate] | [![][img-repo]][repo-tinytemplate] | interpreted | [![][dl-tinytemplate]][tinytemplate] | [![][stars-tinytemplate]][repo-tinytemplate] | [![][contr-tinytemplate]][repo-tinytemplate] | [![][act-tinytemplate]][repo-tinytemplate] |
| [vy] | [![][docs-img-vy]][docs-vy] | [![][img-repo]][repo-vy] | pre-compiled | [![][dl-vy]][vy] | [![][stars-vy]][repo-vy] | [![][contr-vy]][repo-vy] | [![][act-vy]][repo-vy] |
| [yew] | [![][docs-img-yew]][docs-yew] | [![][img-repo]][repo-yew] | ssr | [![][dl-yew]][yew] | [![][stars-yew]][repo-yew] | [![][contr-yew]][repo-yew] | [![][act-yew]][repo-yew] |

Please see also [*Rust web framework comparison*].

## Benchmark Results

The benchmarking was done on Github's action runners, on an AMD-64 Linux system.
The absolute performance can vary, but the relative performance of crate *X* to *Y* should be stable.

[![](https://askama-rs.github.io/template-benchmark/results.svg)](https://askama-rs.github.io/template-benchmark/)

More information can be found in: .

The "big table" benchmark generates a 100×100 cell HTML table.
The "teams" benchmark contains a list of four sport teams and their scores.
The former test contains only raw data, but a lot of it.
The latter test includes texts that (might) need escaping, and "if" conditions.

To run the benchmarks on your machine, clone the repo, and execute `cargo benchmark`.
The console will contain performance numbers,
and the file `target/criterion/report/index.html` will contain more information.
Run `./generate-table.py` to generate the table you see above.

[*Rust web framework comparison*]:
[img-repo]:

[askama]:
[dioxus]:
[handlebars]:
[horrorshow]:
[hypertext]:
[leptos]:
[liquid]:
[markup]:
[maud]:
[minijinja]:
[ructe]:
[sailfish]:
[sycamore]:
[tera]:
[tinytemplate]:
[vy]:
[yew]:

[docs-askama]:
[docs-dioxus]:
[docs-handlebars]:
[docs-horrorshow]:
[docs-hypertext]:
[docs-leptos]:
[docs-liquid]:
[docs-markup]:
[docs-maud]:
[docs-minijinja]:
[docs-ructe]:
[docs-sailfish]:
[docs-sycamore]:
[docs-tera]:
[docs-tinytemplate]:
[docs-vy]:
[docs-yew]:

[docs-img-askama]:
[docs-img-dioxus]:
[docs-img-handlebars]:
[docs-img-horrorshow]:
[docs-img-hypertext]:
[docs-img-leptos]:
[docs-img-liquid]:
[docs-img-markup]:
[docs-img-maud]:
[docs-img-minijinja]:
[docs-img-ructe]:
[docs-img-sailfish]:
[docs-img-sycamore]:
[docs-img-tera]:
[docs-img-tinytemplate]:
[docs-img-vy]:
[docs-img-yew]:

[dl-askama]:
[dl-dioxus]:
[dl-handlebars]:
[dl-horrorshow]:
[dl-hypertext]:
[dl-leptos]:
[dl-liquid]:
[dl-markup]:
[dl-maud]:
[dl-minijinja]:
[dl-ructe]:
[dl-sailfish]:
[dl-sycamore]:
[dl-tera]:
[dl-tinytemplate]:
[dl-vy]:
[dl-yew]:

[stars-askama]:
[stars-dioxus]:
[stars-handlebars]:
[stars-horrorshow]:
[stars-leptos]:
[stars-liquid]:
[stars-hypertext]:
[stars-markup]:
[stars-maud]:
[stars-minijinja]:
[stars-ructe]:
[stars-sailfish]:
[stars-sycamore]:
[stars-tera]:
[stars-tinytemplate]:
[stars-vy]:
[stars-yew]:

[contr-askama]:
[contr-dioxus]:
[contr-handlebars]:
[contr-horrorshow]:
[contr-hypertext]:
[contr-leptos]:
[contr-liquid]:
[contr-markup]:
[contr-maud]:
[contr-minijinja]:
[contr-ructe]:
[contr-sailfish]:
[contr-sycamore]:
[contr-tera]:
[contr-tinytemplate]:
[contr-vy]:
[contr-yew]:

[act-askama]:
[act-dioxus]:
[act-handlebars]:
[act-horrorshow]:
[act-hypertext]:
[act-leptos]:
[act-liquid]:
[act-markup]:
[act-maud]:
[act-minijinja]:
[act-ructe]:
[act-sailfish]:
[act-sycamore]:
[act-tera]:
[act-tinytemplate]:
[act-vy]:
[act-yew]:

[repo-askama]:
[repo-dioxus]:
[repo-handlebars]:
[repo-horrorshow]:
[repo-hypertext]:
[repo-leptos]:
[repo-liquid]:
[repo-markup]:
[repo-maud]:
[repo-minijinja]:
[repo-ructe]:
[repo-sailfish]:
[repo-sycamore]:
[repo-tera]:
[repo-tinytemplate]:
[repo-vy]:
[repo-yew]: