Repository navigation
perf(ci): bring the Numeric Ranges job from 5.6 min to about 1 min - #4660
Conversation
Size Report
Startup median (7 runs, lower is better):
|
|
Nice work. At 60eb5f2 I found nothing that needs to change, so the code is ready. There are no conflicts, and 17 of 18 checks are green, including Numeric Ranges at 1m20s; only the last check is still queued. The diff touches only the ci.yml comment and timeout plus one test file, so no failing route applies to it. Before merge, mark it ready, fill the PR body TBDs with 60eb5f2 and the measured 54 s step, and let the last check finish. Not blocking, take or leave: the 5 min job-wide timeout leaves about 4x room over the 77 s job, so a regression of 245-265 s of step time would still pass, and 3 min would match the new baseline better. The ci.yml comment and the AstNode doc block repeat measurement history that will go stale, so a one-line rule is enough there. AstNode is now a hand-written shape of the oxc-parser output, so asserting the exact collected set (about 18 literals) would turn a partial extraction miss red. |
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Apex Sentinel: 1 new finding on 60eb5f2. The verdict and the full list are in the summary comment.
The range gate classifies every function parameter's declared type before it analyzes the function, and this file took `oxc-parser`'s whole `Expression` union as its parameter type. That union is every AST kind, each a record of further such unions, so one file cost more analysis time than the rest of the repository combined: `pnpm exec fr` went 146s to 21s on the same machine when the reader declares the node fields it reads. The reader's verdict is unchanged, and the test now pins the literal set it collects: `src/cli.ts` yields 18 command literals, and a reader that stops collecting fails the deep-equal instead of passing over an empty loop. `scripts/lib/shipped-imports.ts` already records the same constraint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The audit's cost is per function parameter type, so a parameter typed as a parser's whole expression union makes one file cost minutes of analysis. The budget goes on the step rather than the job: a lockfile-changing PR pays a cold install in Setup toolchain, and that must not decide whether the gate runs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
60eb5f2 to
90ba157
Compare
|
I found no problems in the code at 90ba157. The job timeout is back to 20 minutes (https://github.com/callstack/agent-device/blob/90ba157/.github/workflows/ci.yml#L279) and the 3-minute budget now sits on the Check numeric ranges step (https://github.com/callstack/agent-device/blob/90ba157/.github/workflows/ci.yml#L291), so checkout and a cold install can no longer trip it. That fixes the earlier timeout concern, and nothing else remains from my side. The thread on the job timeout covering setup time (#4660 (comment)) no longer applies at this head, so you can resolve it. There are no conflicts, and the one check still pending is queued, not failed. The diff touches only The identical coverage counts, the 54 s step timing and the planted-violation check come from the PR body. |
Apex Sentinel · ✅ Approve · review of
|
| Command | What it does |
|---|---|
@apex-sentinel-staging note <context> |
Adds context; Sentinel re-checks the cited code |
@apex-sentinel-staging pivot <why> |
Says the finding is wrong; Sentinel re-checks the cited code |
@apex-sentinel-staging like |
Marks the finding as useful |
@apex-sentinel-staging dislike <why> |
Marks it as not useful, so it is not raised again |
On this conversation, comment @apex-sentinel-staging review to run a full review once again.
Summary
The
Numeric Rangesgate (fr) classifies every function parameter's declared type before it analyzes a function.src/cli-command-dispatch.test.tstyped its parameters withoxc-parser'sExpressionunion — every AST kind, each a record of further such unions. That one file cost more analysis time than the rest of the repository combined. The reader now declares the node fields it reads.Check numeric rangesalso gets its owntimeout-minutes: 3, so a range-analysis regression fails the lane instead of passing as slow green. The job keepstimeout-minutes: 20; a cold install runs in Setup toolchain and cannot trip the step budget.Check numeric rangesstep:The job falls from 362 s to 87 s. Numeric Ranges is no longer the slowest CI job. Locally, the same command went 146 s → 21 s.
Validation
frreports0 findingsand identical project-wide coverage counts before and after; a plantedconsole.assertviolation in a production file still fails the gate with exit 1.src/cli.ts, now pinned by a deep-equal. A reader that stops collecting fails it. Renaming a dispatch comparison insrc/cli.tsstill fails the test.🤖 Generated with Claude Code