rosetta-rs / template-benchmarks-rs

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

Use handlebars context api to align the benchmark scope #28

Closed sunng87 closed 4 years ago

sunng87 commented 4 years ago

Thanks for maintaining this benchmark. This patch uses the latest API from handlebars that reuse the context in benchmark.

The reason handlebars was slower in this benchmark was because the Context data was created within b.iter block. The result we saw included time to serialize it. I checked Tera example, its context was created outside the benchmarking block. So this patch moved Context creation outside to align the baseline with other libraries.

Let me know if you have any question about handlebars. Thanks again for this test. This benchmark has been insightful to me to keep improving handlebars.

sunng87 commented 4 years ago

By the way, the ruste and sailfish code seems broken. I suggest to use a released version in this test to avoid this compatibility issue.

djc commented 4 years ago

Makes sense, sorry for treating handlebars wrong all this time!

These benchmarks depend on latest git on purpose, I'll fix up ructe and sailfish soon.