[PR #7102] perf(native): index PE export string mappings #7643

Open
opened 2026-11-03 13:39:20 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/7102
Author: @enghossamasasecounsultants-boop
Created: 10/25/2026
Status: 🔄 Open

Base: main ← Head: perf/index-pe-export-string-mappings


📝 Commits (2)

  • 81f3aac perf(native): index PE export string mappings
  • 8d6225d perf(native): gate PE mapping index by export count

📊 Changes

2 files changed (+73 additions, -41 deletions)

View changed files

📝 src/native/exports/NativeExportParser.test.ts (+58 -28)
📝 src/native/exports/NativeExportParser.ts (+15 -13)

📄 Description

Summary

PE export names are resolved in a loop bounded by the export-name count. Each readMappedCString call scans the image mappings, repeating work for larger name tables. Reuse the existing file-mapping index only when there are at least 16 exported names; smaller inventories keep the simple linear path.

Correctness and scope

Indexed and non-indexed paths are both covered for names spanning adjacent sections, conflicting mappings after the terminator, and conflicts overlapping the name. Output and CLI/MCP contracts are unchanged.

Evidence and validation

  • npm run test:local -- src/native/exports/NativeExportParser.test.ts — 35 tests passed.
  • npm run check:fast — typecheck and lint passed.
  • oxfmt --check and git diff --check passed.
  • Synthetic fixture benchmark, Node v24.21.0, 8,000 parses/sample, three samples; median wall time for 16 names was 408→350 ms (one section), 425→390 ms (four sections), and 463→424 ms (six sections), an 8–14% reduction. The 2- and 8-name cases retain the linear path.
  • CPU time and sampled peak RSS did not show a consistent improvement: for 16 names, CPU medians were 485→453, 516→624, and 484→672 ms; sampled RSS growth was 2.2→3.8, 2.5→3.6, and 1.9→3.7 MiB across the same section counts. These are synthetic fixtures, not real workload profiles; the memory and CPU tradeoffs need human review before merge. Token impact is not applicable to this offline parser.

Author readiness

Human owner review and readiness declarations remain for the human contributor.


🔄 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/7102 **Author:** [@enghossamasasecounsultants-boop](https://github.com/enghossamasasecounsultants-boop) **Created:** 10/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `perf/index-pe-export-string-mappings` --- ### 📝 Commits (2) - [`81f3aac`](https://github.com/morluto/rea/commit/81f3aacef2de7e35bddc594b82bc85416b3e47a9) perf(native): index PE export string mappings - [`8d6225d`](https://github.com/morluto/rea/commit/8d6225de64653db1101566fb8206d339b5313362) perf(native): gate PE mapping index by export count ### 📊 Changes **2 files changed** (+73 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `src/native/exports/NativeExportParser.test.ts` (+58 -28) 📝 `src/native/exports/NativeExportParser.ts` (+15 -13) </details> ### 📄 Description ## Summary PE export names are resolved in a loop bounded by the export-name count. Each `readMappedCString` call scans the image mappings, repeating work for larger name tables. Reuse the existing file-mapping index only when there are at least 16 exported names; smaller inventories keep the simple linear path. ## Correctness and scope Indexed and non-indexed paths are both covered for names spanning adjacent sections, conflicting mappings after the terminator, and conflicts overlapping the name. Output and CLI/MCP contracts are unchanged. ## Evidence and validation - `npm run test:local -- src/native/exports/NativeExportParser.test.ts` — 35 tests passed. - `npm run check:fast` — typecheck and lint passed. - `oxfmt --check` and `git diff --check` passed. - Synthetic fixture benchmark, Node v24.21.0, 8,000 parses/sample, three samples; median wall time for 16 names was 408→350 ms (one section), 425→390 ms (four sections), and 463→424 ms (six sections), an 8–14% reduction. The 2- and 8-name cases retain the linear path. - CPU time and sampled peak RSS did not show a consistent improvement: for 16 names, CPU medians were 485→453, 516→624, and 484→672 ms; sampled RSS growth was 2.2→3.8, 2.5→3.6, and 1.9→3.7 MiB across the same section counts. These are synthetic fixtures, not real workload profiles; the memory and CPU tradeoffs need human review before merge. Token impact is not applicable to this offline parser. ## Author readiness Human owner review and readiness declarations remain for the human contributor. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7643
No description provided.