[PR #1537] [MERGED] perf(javascript): index returned object targets #2954

Closed
opened 2026-10-17 21:12:12 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1537
Author: @geekwolf
Created: 10/10/2026
Status: ✅ Merged
Merged: 10/10/2026
Merged by: @N0zoM1z0

Base: main ← Head: fix/js-returned-reference-index


📝 Commits (4)

  • 04875e7 perf(javascript): index returned object targets
  • f2f56b5 test(javascript): cover returned object scaling
  • 1268cb3 chore(review): integrate main for returned-target index verification
  • 426aa62 test(javascript): remove duplicate escaped-receiver cases

📊 Changes

2 files changed (+95 additions, -1 deletions)

View changed files

📝 src/domain/javascript/javascriptSemanticAnalysis.member_mutations.test.ts (+15 -0)
📝 src/domain/javascript/javascriptSemanticReturnedReferences.ts (+80 -1)

📄 Description

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.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1537 **Author:** [@geekwolf](https://github.com/geekwolf) **Created:** 10/10/2026 **Status:** ✅ Merged **Merged:** 10/10/2026 **Merged by:** [@N0zoM1z0](https://github.com/N0zoM1z0) **Base:** `main` ← **Head:** `fix/js-returned-reference-index` --- ### 📝 Commits (4) - [`04875e7`](https://github.com/morluto/rea/commit/04875e7817ffecdf77641220dc6471f2c9e615c0) perf(javascript): index returned object targets - [`f2f56b5`](https://github.com/morluto/rea/commit/f2f56b58047959a397a7bb0d445c9a1764745f90) test(javascript): cover returned object scaling - [`1268cb3`](https://github.com/morluto/rea/commit/1268cb328fa22e387e0ecffda0c2b345658d0476) chore(review): integrate main for returned-target index verification - [`426aa62`](https://github.com/morluto/rea/commit/426aa62c1033335b8b5d236011f8368afc1ac816) test(javascript): remove duplicate escaped-receiver cases ### 📊 Changes **2 files changed** (+95 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/javascriptSemanticAnalysis.member_mutations.test.ts` (+15 -0) 📝 `src/domain/javascript/javascriptSemanticReturnedReferences.ts` (+80 -1) </details> ### 📄 Description 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. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:12:12 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2954
No description provided.