Skip to content

Add complex-expression benchmark#691

Merged
Kijewski merged 2 commits intoaskama-rs:mainfrom
Kijewski:pr-bench
Feb 4, 2026
Merged

Add complex-expression benchmark#691
Kijewski merged 2 commits intoaskama-rs:mainfrom
Kijewski:pr-bench

Conversation

@Kijewski
Copy link
Copy Markdown
Member

@Kijewski Kijewski commented Feb 3, 2026

A simple benchmark to test how fast the parser and generator can handle a template with a complex binary operator expression ({{ a + b * c / d ... }}).

}

fn binary_ops(c: &mut Criterion) {
let mut rng = Xoroshiro64StarStar::seed_from_u64(PRIME64);

Check failure

Code scanning / devskim

Use cryptographic random numbers generators for anything even close to a security function. Error

Do not use weak/non-cryptographic random number generators
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No security needed in a benchmark, only repeatability.

Comment thread askama_parser/benches/parse-complex-expression.rs Dismissed
@Kijewski
Copy link
Copy Markdown
Member Author

Kijewski commented Feb 3, 2026

Hm, again the problem with truncated error messages in the UI tests. Seems like sometimes the terminal width is taken into account and sometimes not. Different action runner versions? The terminal width seems to be 141 columns on the current runner.

We should override the default terminal width in UI tests to something huge. Will have a look tomorrow.

* Break overly long lines that are truncated in trybuild [v1.0.105]
* Fix mistakes that are not part of the test, mostly missing return
  values
* Require more current trybuild dev-dependency

[v1.0.105]: <https://redirect.github.com/dtolnay/trybuild/releases/tag/1.0.115>
A simple benchmark to test how fast the parser and generator can handle
a template with a complex binary operator expression (`{{ a + b * c / d
... }}`).
@Kijewski Kijewski merged commit 54eb534 into askama-rs:main Feb 4, 2026
50 checks passed
@Kijewski Kijewski deleted the pr-bench branch February 4, 2026 19:26
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

Successfully merging this pull request may close these issues.

2 participants