Repository navigation
test(editor): time the routine scan against itself, not a fixed limit - #3999
Merged
Merged
Conversation
routineBodiesStayLinear failed on a PR with no app code at 0.551 s against a fixed 0.5 s limit, while main measured the same scan at 0.25 to 0.38 s. The scanner is linear; one sample on a shared runner swings about 2x. The test now compares one scan of 8,000 routines with four scans of 2,000, the fastest of three interleaved samples each, and fails when the long scan takes twice as long. Linear scanning gives 1x and quadratic scanning 4x.
datlechin
enabled auto-merge (squash)
November 2, 2026 20:02
datlechin
disabled auto-merge
November 2, 2026 20:51
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
StatementRunPerformanceGuardTests.routineBodiesStayLinearfailed on build(release): open the DMG to a laid-out Finder window #3990, which changes no app code, at 0.551 s against a fixed 0.5 s limit. Green runs on main took 0.25 to 0.38 s for the same scan. One sample swings about 2x between runs, and the limit left less than 2x of room.OptionSetgenerics behindgrammar.contains, which every statement pays, not to block tracking.Test plan
verify.sh test StatementRunPerformanceGuardTests SQLFoldPerformanceGuardTests: PASS, 9 executed, 9 passed. The new case takes 0.6 s on this Mac in a debug build.routineBodiesStayLinearwith-test-iterations 20 -run-tests-until-failure: 20 of 20 passed.;inside a body, the ratio was 2.5 to 4.3, so the test fails on it.