Repository navigation
perf: recover the Oct 12-19 fixed-cost drift (0286) - #617
Merged
Merged
Conversation
Callgrind diffs of each merge since 8f13350 against its first parent found inlining and copy costs the feature merges added in passing: - IsInEqual's number-visitor fallback is out of line, so the int fast path of `x in [...]` needs no frame (Render/expressions -6.3%) - map() reads its filter's argument error once per call, not per item - the markup join of `~` is its own function, so the plain concatenation inlines into BinaryExpression::Apply again (Render/strings -2.6%) - range() looks each argument up once - FindKeyword is forced inline into the lexer callback again No case is worse than master. The remainder against 8f13350, each the price of a feature, is listed with its Ir in docs/tasks/0286. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016vJUPZkx4gkbvj2T5VCJwE
Member
Author
|
@codex review @codex security review Generated by Claude Code |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
rmorozov
marked this pull request as ready for review
October 23, 2026 14:17
rmorozov
added a commit
that referenced
this pull request
Oct 23, 2026
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.
Requested by Ruslan · project thread
Problem
The 2026-10-19 scout (task 0286) found a week of fixed-cost drift since 8f13350 (0158). Each feature merge stayed under the +3% gate. Together they moved Render/strings +8.4%, plain_text +4.1%, for_range +3.2%, substitute +3.0%, and expressions, macros and mitsuhiko_table about +1.8%. Load went up +1.3..2.9% on five cases.
What changed
I diffed each suspect merge with callgrind against its first parent (#545, #558, #606, trains 26 and 27), as 0205 did, and fixed the inlining and copy costs these merges added in passing. Every fix is behaviour-neutral.
src/testers.cpp: the number-visitor fallback ofIsInEqualis out of line. The int fast path ofx in [...]no longer pays a frame the BigInt arms enlarged.src/filters.cpp:map()reads its filter's argument error once per call instead of copying it for every item. It still raises at the first item, and not at all for an empty list.src/expression_evaluator.cpp: the markup join of~(0051) is its own function. Plain concatenation inlines intoBinaryExpression::Applyagain.src/global_functions.cpp:range()looks each argument up once.src/template_parser.h:FindKeywordis forced inline into the lexer callback again.docs/tasks/0286: done, with the measured results and the accepted remainder, each item with its Ir and the feature it pays for.Results
bench/count.py, Release GCC 13, all builds running today's cases:No case is worse than master. The chat_mistral allocation step (360 to 448) compared two different versions of the case. Like for like, 8f13350 makes 450 allocations and master 428.
Remaining limits
What is left against 8f13350 is the price of features, listed in the task file:
selfname, EvalContext, cycle collector and autoescape selector: +40 Ir per renderloop.cycleposition cell: +2 Ir per item, plus +21 Ir per loop on recycleLoad drift is recovered separately by #612 and #616, so the remainder against 8f13350 should be re-measured after those land (perf track note).
Validation
scripts/preflight.sh --perf: clang-format, clang-tidy 22.1.8 on changed lines, null comparisons, the CodeQL pattern, task files and the +3% instruction gate all pass.map()argument errors,range()and~match.Roles: main session (attribution and fixes), verifier (1 round). Red CI pushes: 0.
Codex: 0 findings, 0 fixed, 0 declined (code review on f9b05c4). The security review was requested but Codex did not start it.
Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_016vJUPZkx4gkbvj2T5VCJwE