Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison with Tera and Askama #55

Open
godofdream opened this issue Nov 17, 2021 · 1 comment
Open

Comparison with Tera and Askama #55

godofdream opened this issue Nov 17, 2021 · 1 comment

Comments

@godofdream
Copy link

It seems ramhorns is pretty fast, however could you explain in some words, why it's faster than even askama?

@maciejhirsz
Copy link
Owner

Those benches are pretty old, but I've just re-run it against Askama 10.5 and it mostly still holds. As to why, I don't know, I haven't looked at Askama code.

In principle the way Askama works it could/should be faster, as Ramhorns is doing some work that Askama does not have to do. That piece of work in Ramhorns is however the single most optimized part of the whole crate, the whole thing is built around having as little overhead in dynamic templates as possible. There are more factors at play, and since we are in nanosecond range things like error handling when doing writes to the output buffer can have relatively significant effect on total time.

Someone once forked a fork of Askama, and that fork run faster than Ramhorns, but I believe there were some disagreements between the authors, including license issues, and I don't think any of those optimizations landed upstream.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants