[PR #942] [MERGED] perf(javascript): index semantic fingerprint relations #2519

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

📋 Pull Request Information

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

Base: main ← Head: codex/semantic-fingerprint-index


📝 Commits (1)

  • d5875b4 perf(javascript): index semantic fingerprint relations

📊 Changes

2 files changed (+113 additions, -32 deletions)

View changed files

📝 src/domain/javascript/javascriptSemanticAnalysis.calls.test.ts (+45 -0)
📝 src/domain/javascript/javascriptSemanticFingerprints.ts (+68 -32)

📄 Description

Summary

Semantic fingerprint collection repeatedly scanned every call site, closure capture, and effect collection once per callable. Build owner indexes and capture counts once, then preserve each owner's original relation/effect order while constructing fingerprints. This reduces full public analysis time on effect-heavy modules without changing emitted IR.

Evidence

A five-sample interleaved comparison on Node v24.18.0 / macOS arm64 analyzed the same generated 3,000-handler, 635,711-byte input against base 37d2ebac4c2a524eec6e32c4c57cbbb632491ad8 and candidate d5875b432fd51e5a223de001d593de78d5665a76. Median full-analysis time fell from 3,405.10 ms to 917.23 ms (73.06%). Both outputs serialize to 46,433,346 bytes with the same SHA-256 (1dc7e23b2c5d8e6325f900bb6cba865b95355db1ced1d8ec9b3b9133cba0ff2d) and contain 9,000 callables and fingerprints.

The complete public IR is byte-for-byte identical on 30 cases: three ordinary examples, 23 checked-in JavaScript fixture files, and effect-heavy modules with 100, 500, 1,500, and 3,000 handlers. The installed Babel parser source (480,937 bytes) also produces the same complete 12,682,139-byte public IR on both builds (SHA-256 39561607a098ea0adb94e714149109c4848ff75e9d1eb2283b610cea7717e96e). Comparison scripts and input/result hashes are saved under .cache/performance-893/ for this review.

Verification

  • npm run build:cached
  • npm exec vitest -- run --project domain (113 files, 1,364 tests)
  • npm run check:fast
  • npm run format:check (1,756 files)

No real provider verification applies; this is provider-neutral JavaScript semantic analysis.


🔄 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/942 **Author:** [@morluto](https://github.com/morluto) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@morluto](https://github.com/morluto) **Base:** `main` ← **Head:** `codex/semantic-fingerprint-index` --- ### 📝 Commits (1) - [`d5875b4`](https://github.com/morluto/rea/commit/d5875b432fd51e5a223de001d593de78d5665a76) perf(javascript): index semantic fingerprint relations ### 📊 Changes **2 files changed** (+113 additions, -32 deletions) <details> <summary>View changed files</summary> 📝 `src/domain/javascript/javascriptSemanticAnalysis.calls.test.ts` (+45 -0) 📝 `src/domain/javascript/javascriptSemanticFingerprints.ts` (+68 -32) </details> ### 📄 Description ## Summary Semantic fingerprint collection repeatedly scanned every call site, closure capture, and effect collection once per callable. Build owner indexes and capture counts once, then preserve each owner's original relation/effect order while constructing fingerprints. This reduces full public analysis time on effect-heavy modules without changing emitted IR. ## Evidence A five-sample interleaved comparison on Node v24.18.0 / macOS arm64 analyzed the same generated 3,000-handler, 635,711-byte input against base `37d2ebac4c2a524eec6e32c4c57cbbb632491ad8` and candidate `d5875b432fd51e5a223de001d593de78d5665a76`. Median full-analysis time fell from 3,405.10 ms to 917.23 ms (73.06%). Both outputs serialize to 46,433,346 bytes with the same SHA-256 (`1dc7e23b2c5d8e6325f900bb6cba865b95355db1ced1d8ec9b3b9133cba0ff2d`) and contain 9,000 callables and fingerprints. The complete public IR is byte-for-byte identical on 30 cases: three ordinary examples, 23 checked-in JavaScript fixture files, and effect-heavy modules with 100, 500, 1,500, and 3,000 handlers. The installed Babel parser source (480,937 bytes) also produces the same complete 12,682,139-byte public IR on both builds (SHA-256 `39561607a098ea0adb94e714149109c4848ff75e9d1eb2283b610cea7717e96e`). Comparison scripts and input/result hashes are saved under `.cache/performance-893/` for this review. ## Verification - `npm run build:cached` - `npm exec vitest -- run --project domain` (113 files, 1,364 tests) - `npm run check:fast` - `npm run format:check` (1,756 files) No real provider verification applies; this is provider-neutral JavaScript semantic analysis. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:07:05 +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#2519
No description provided.