Skip to content

perf(elf): cache BinaryReader and support offset reads in elfNoteLayout - #13688

Merged
morluto merged 1 commit into
mainfrom
perf/elf-note-binary-reader-cache
Nov 22, 2026
Merged

morluto merged 1 commit into
mainfrom
perf/elf-note-binary-reader-cache

Conversation

@morluto

@morluto morluto commented Nov 22, 2026

Copy link
Copy Markdown
Owner

Closes #13687

Summary

  • Cache BinaryReader per (Uint8Array, littleEndian) via WeakMap in src/domain/native/elfNoteLayout.ts and add an optional offset = 0 parameter to readElfNoteHeader and readElfNoteFrame.
  • Replace bytes.every(...) closure in isElfNotePadding with an indexed loop.
  • Update ElfNoteParser.parseNoteStream to pass table and at directly to readElfNoteFrame, eliminating per-note table.subarray and BinaryReader allocations.
  • Add offset-read unit coverage in src/domain/native/elfNoteLayout.test.ts.

Validation

  • npm run test:local -- src/domain/native/elfNoteLayout.test.ts src/native/elf/ElfNoteParser.test.ts (2 files, 105 passed, 1 skipped)
  • npm run check:fast (typecheck, lint, architecture guards passed)

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T22:42:50.073252Z 04634ea PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

This PR reuses BinaryReader instances and reads note headers directly from a shared table.

  • ELF note parsing reads headers by offset and reuses its table reader.

Tests were inspected but not rerun. Whether another PR supersedes this one could not be checked because GitHub access required authentication.

Reviews (2) · Last reviewed commit: "perf(elf): cache BinaryReader and suppor..." · Reviewed by Greptile

@morluto
morluto enabled auto-merge (squash) November 22, 2026 22:49
@morluto
morluto merged commit 43f5d2a into main Nov 22, 2026
43 checks passed
@morluto
morluto deleted the perf/elf-note-binary-reader-cache branch November 22, 2026 23:13
@morluto morluto added area: native Native analysis and decompilation, including Ghidra, IDA, and Hopper analysis behavior performance Performance regressions, scaling limits, and bounded-resource work labels Nov 22, 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.

perf(elf): cache BinaryReader and support offset reads in elfNoteLayout

1 participant