Repository navigation
perf(native): run independent Mach-O slice commands concurrently - #2466
Merged
Merged
Conversation
inspect_macho launched otool, nm, two dyld_info reads, dwarfdump and vtool one at a time. Each launch also resolves the tool through `xcrun --find`, so a warm call spent about 350 ms in eight serial supervised launches. The slice commands only read the selected artifact, so launch them together. Every launch still settles before the result, and declared order still fixes provenance and which failure is reported. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
34 tasks done
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
inspect_machoran its six per-slice commands (otool -h -l,nm -gjU,dyld_info -imports,dyld_info -exports,dwarfdump --uuid, optionalvtool -show-build) one after another. Each command also resolves its tool throughxcrun --findfirst, so a warm call made 16 supervised process launches in series (about 46 ms per command on this Mac).The six commands only read the selected artifact and don't depend on each other. They now start together after
liposelects the slice. No behavior changes:provenance, stay in declared order.fileandlipostay serial because slice selection depends on them.Measurements
macOS 26 (Apple silicon), Node 26.5.0, local build, MCP stdio client. Each run is a fresh server:
open_binary, theninspect_machocalled 4 times. Cold is the firstinspect_machocall per run (median of 3 runs). Warm is calls 2–4 (median of 9 calls across the 3 runs)./bin/ls(universal, 20.9k chars of output)The result text is the same size before and after. A field-by-field diff of the
/bin/lsresult, ignoring IDs and timestamps, showed no differences.Tests
src/native/NativeMachoInspection.test.ts: a runner that finishes later-launched commands first. It checks that all six slice commands are in flight together, thatprovenancestays in declared order, and that withnmanddwarfdumpboth failing (dwarfdumpfinishing first) thenmfailure is reported. Before the change the first test fails (max in flight 1).Checks
npm run check(pass) andnpm run test:focusedon the 23 test files that mentioninspect_machoorNativeMacOSProvider(356 tests, pass).npm run check:pr, the full test suite, anddocs:check(no contract or schema change).xcrun,otool,nm,dyld_info,dwarfdumpandvtool.AI agent note
An AI agent (Claude Code) wrote this PR during a scheduled maintenance loop. A human did not review the diff or the measurements before submission.
🤖 Generated with Claude Code