Skip to content

Benchmark against Jinja - #16

Merged
Tronic merged 8 commits into
mainfrom
jinja2
Jul 10, 2026
Merged

Tronic merged 8 commits into
mainfrom
jinja2

Conversation

@Tronic

@Tronic Tronic commented Jul 9, 2026

Copy link
Copy Markdown
Member

Includes a benchmark script, with results updated on README.

Generated HTML length:  45230 bytes (Jinja 66772 bytes)
Product items on page:  100

Single page render time (averaged over 1000 renders):
  Full generation:                 1.248 ms  (12 µs/item)
  Full generation w/ selectors:    1.521 ms  (15 µs/item)
  Template:                        0.204 ms  ( 2 µs/item)

Jinja for comparison:
  Template file:                   0.896 ms  ( 9 µs/item)
  Template preloaded:              0.234 ms  ( 2 µs/item)

Templating is 6.1x faster than from-scratch generation, and 1.2x faster than Jinja (preloaded; 4.4x file).

Copilot AI review requested due to automatic review settings July 9, 2026 23:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a benchmarking workflow to compare html5tagger’s templating performance against Jinja and documents the observed results in the README.

Changes:

  • Extend scripts/benchmark.py to optionally benchmark equivalent rendering via Jinja (preloaded vs template-loaded-per-call).
  • Add a new “Performance” section to README.md summarizing benchmark results and interpretation.
  • Add a benchmark dependency group (Jinja2) and adjust metadata keywords.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
scripts/benchmark.py Adds Jinja-based benchmarks and updates benchmark output formatting/instructions.
README.md Documents benchmark results and adds a performance discussion section.
pyproject.toml Adds a benchmark dependency group (jinja2) and updates keywords/formatting.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/benchmark.py Outdated
Comment thread scripts/benchmark.py
Comment thread scripts/benchmark.py Outdated
Comment thread scripts/benchmark.py Outdated
Comment thread README.md Outdated
@Tronic
Tronic merged commit 728b0d7 into main Jul 10, 2026
7 checks passed
@Tronic
Tronic deleted the jinja2 branch July 10, 2026 01:40
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