rosetta-rs / template-benchmarks-rs

Collected benchmarks for templating crates written in Rust
225 stars 29 forks source link

Why is Tera's render called twice? #88

Open olsuh opened 1 year ago

olsuh commented 1 year ago

Why is Tera's render called twice? https://github.com/rosetta-rs/template-benchmarks-rs/blob/main/src/tera.rs#L21-L22 https://github.com/rosetta-rs/template-benchmarks-rs/blob/main/src/tera.rs#L66-L67

djc commented 1 year ago

Exactly because of what you describe in #89: it forces the template engine to do all the necessary setup.

olsuh commented 1 year ago

Sorry I was confused. :)

olsuh commented 1 year ago

I put the debug output between these two lines. And I saw that there were many calls. It's too much to warm up.

djc commented 1 year ago

template-benchmarks-rs is currently a low priority for me. I think the code across all the template engines is pretty similar so in that sense it seems fair to me. If you want to submit a PR to change something I'll consider it, but it will have to be well-argued.