Repository navigation
Conversation
1 task
This comment was marked as resolved.
This comment was marked as resolved.
Member
|
Same thing here, unless changes can stand on their own review must wait. |
Neroued
force-pushed
the
perf/jinja-loops
branch
4 times, most recently
from
November 14, 2026 13:28
c8ba7ec to
73839c1
Compare
Member
|
Oh hey, forgot about this one, mind rebasing and marking ready for review? |
Assisted-by: GPT-6 Astra
Neroued
force-pushed
the
perf/jinja-loops
branch
from
November 22, 2026 06:16
73839c1 to
d24b5e2
Compare
Neroued
marked this pull request as ready for review
November 22, 2026 06:28
Contributor
Author
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Loop-rendering optimizations for #32002, rebased on current master.
Evaluates ranges, loop bindings, filters, and loop metadata on demand, and accumulates output directly. Fixes output lost through nested
break/continueand avoids unpacking elements that execution never reaches.Uses the upstream scope-chain implementation. Deferred filters retain live bindings while a render is active, including loops saved beyond their original scope; their captures are released on return or error. An exhausted iterator stays exhausted. Existing
for/elsebehavior is preserved and checked against Jinja2.Additional information
Full CPU build and related chat/template tests passed on x86. Jinja tests and Python/Jinja2 comparisons passed on x86 and DGX Spark. Targeted ASan/UBSan checks with leak detection passed: 26 tests, 38 assertions.
Before: upstream master
225a5345b. After: this standalone change. Median of five renders after warmup, in milliseconds; templates compiled once. Timing includes JSON-to-Value conversion, execution, output gathering and context destruction, and excludes template compilation and input JSON parsing. GCC 13.3, C++17, Release; Python 3.11 / Jinja2 3.1.6. Runs use one pinned CPU core.The two C++ builds produce identical text and marked string parts on these workloads; rendered text also matches Jinja2. The benchmark harness remains in the independent reference branch. This PR contains implementation changes and correctness tests only.
Requirements