Skip to content

perf(javascript): index returned object targets - #1537

Merged
N0zoM1z0 merged 4 commits into
morluto:mainfrom
geekwolf:fix/js-returned-reference-index
Oct 10, 2026
Merged

N0zoM1z0 merged 4 commits into
morluto:mainfrom
geekwolf:fix/js-returned-reference-index

Conversation

@geekwolf

@geekwolf geekwolf commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

When several calls select methods from the same object literal, returned-reference analysis repeatedly scans all of its properties. This change builds an analysis-local syntax index once, preserving duplicate keys, trailing spread/computed candidates, callable captures, dynamic-key fallback, and receiver-effect ownership.

Fixes #1495.

The maintainer follow-up removes an exactly duplicated two-test describe block while retaining its original copy, including the 2,000-method regression.

Validation:

  • Independently built main and this branch, then ran the public CLI and an actual SDK stdio MCP client on the same 2,421-byte fixture with nine exports. Complete normalized results and Evidence IDs match; return-shape coverage remains complete, text/structured output matches, the input remains unchanged, and the subsequent MCP ping succeeds.
  • A production CLI control with in-memory parser-array instrumentation counted 144 property visits on the immutable main returned-reference module and 82 on the indexed module, with unchanged results. This is a structural small-fixture measurement, not a general throughput or billing estimate.
  • 172 distinct relevant tests pass: 156 semantic mutation tests, one stepped-analysis test, 13 cancellation tests, and two public returned-reference acceptance workflows. The repeated unit block was run before removal and its retained copy was rerun afterward.
  • Fresh build, serial full typecheck, lint/module boundaries, formatting, unused-code check, architecture guards, duplication scan, and generated documentation checks pass under the local resource guard.

The default Evidence payload is unchanged: this fixture produces 785,206 CLI bytes and 1,644,176 MCP reply bytes. This CPU optimization makes no claim of reduced output size or token billing. Verification covers JavaScript public CLI/MCP workflows; it does not establish native-provider or large-application performance.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Independent maintenance review is starting on this existing performance PR. I have a separate review branch integrating current merged main c73cf0ab, preserving the contributor history; no source changes have been published to this PR yet.

I will check static-property/dynamic-property/spread ordering and receiver ownership, then exercise small source-owned targets through the actual compiled public CLI and production SDK stdio MCP, with unchanged input and complete Evidence checks. Contributor unit/profile results are attributed to the PR, rather than treated as an independent runtime proof. No large Notion/Obsidian matrix is planned for this review.

@N0zoM1z0

Copy link
Copy Markdown
Collaborator

The index-only scope addresses the concern on #1520: there is no receiver-effect lifetime cache in this revision, and the reverse trailing-unknown chain appears to preserve the previous candidate order.

The branch is based before merged #1517/#1526/#1539. Please integrate current main before landing: main already contains the two escaped-receiver cases added here, including the 2,000-method shared-result case, and removed their unreliable 2-second wall assertion. The new scalar-return scaling case repeats that existing workload. Retain the existing main regressions and avoid duplicating those cases during the merge. The separately fixed wide object/array argument-limit regression from #1539 must also remain in the merged result.

The exact-head CI workflows were approved and are running. For the index boundary, complete-IR comparison should include duplicate static property names, trailing computed properties and trailing spreads, since those are the representations whose lookup/order changed.

@N0zoM1z0
N0zoM1z0 merged commit 9ffc621 into morluto:main Oct 10, 2026
20 checks passed
@N0zoM1z0

Copy link
Copy Markdown
Collaborator

Merged by SHA-guarded rebase after 20/20 checks succeeded on 426aa62c. Both contributor commits retain their authors and added/removed lines; the integrated changed blobs match the tested branch. My commits and rebased committers use the verified GitHub noreply address.

I rebuilt merged 9ffc6210 and repeated the actual public CLI and SDK stdio MCP workflow on the same 2,421-byte, nine-export fixture. Complete normalized results and Evidence IDs still match the main baseline, all return-shape projections are complete, text/structured output agrees, the input remains unchanged, and the subsequent ping succeeds.

The instrumented small-fixture property-scan control decreased from 144 visits to 82; this does not establish general throughput or billing savings. Result bytes remain unchanged. The exact duplicate unit group was removed while preserving its tested copy; 172 distinct relevant tests and the serial local gates pass. The finished worktree and build are removed; source branches and proof receipts are retained.

@morluto morluto added performance Performance regressions, scaling limits, and bounded-resource work area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior labels Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior performance Performance regressions, scaling limits, and bounded-resource work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Many methods returning one object make analysis grow quadratically since #1471

3 participants