perf: reduce template loop render scope churn#135
Merged
Conversation
Contributor
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.
Summary
{{#for}}instead of allocating a freshEnvironmentfor every row.Benchmark
Local DD-061 benchmark harness, dev-release binaries,
wrk3s, 3 runs, 16 connections, 2 threads. Baseline binary wasorigin/mainat52554e9; branch binary was this PR.Raw outputs:
/tmp/ntnt-dd061-pr4-baseline-20260623T062459/ntnt-perf-20260623T122518Z.md/tmp/ntnt-dd061-pr4-branch-20260623T062525/ntnt-perf-20260623T122544Z.mdVerification
cargo build --profile dev-releasecargo test --lib template_cache_cargo test --lib template_loop_scopecargo test --lib template_environment_helper_restores_after_errorcargo test --test language_features_tests test_template_partialcargo test --libcargo test --test language_features_tests --test type_checker_tests --test cli_tests./target/dev-release/ntnt docs --generatecargo fmt -- --checkgit diff --check