feat: add MacOS support#81
Conversation
Merging this PR will degrade performance by 91.73%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ❌ | Memory | wait 1ms |
16 B | 14,792 B | -99.89% |
| ❌ | WallTime | short body |
1.7 µs | 346.8 µs | -99.51% |
| ❌ | WallTime | short body |
1.8 µs | 351.6 µs | -99.5% |
| ❌ | WallTime | short body |
1.7 µs | 339.4 µs | -99.5% |
| ❌ | WallTime | short body |
1.7 µs | 342.4 µs | -99.5% |
| ❌ | WallTime | short body |
1.8 µs | 341.2 µs | -99.48% |
| ❌ | WallTime | short body |
1.8 µs | 334.7 µs | -99.45% |
| ❌ | WallTime | fibo 10 |
2.1 µs | 369.4 µs | -99.43% |
| ❌ | WallTime | fibo 15 |
21.5 µs | 351.6 µs | -93.87% |
| ❌ | WallTime | end |
35.5 µs | 390.5 µs | -90.92% |
| ❌ | WallTime | long body |
214.3 µs | 500.1 µs | -57.14% |
| ❌ | WallTime | long body |
211.7 µs | 492.5 µs | -57.01% |
| ❌ | WallTime | long body |
217.2 µs | 493.2 µs | -55.96% |
| ❌ | WallTime | long body |
217.3 µs | 492 µs | -55.84% |
| ❌ | WallTime | wait 1ms |
1 ms | 1.4 ms | -30.02% |
| ⚡ | Memory | wait 500ms |
64.1 KB | 15 KB | ×4.3 |
| ⚡ | Simulation | short body |
121.2 µs | 73.3 µs | +65.44% |
| ⚡ | Simulation | one |
589.9 µs | 401.9 µs | +46.77% |
| ⚡ | Simulation | wait 500ms |
12.2 ms | 10 ms | +22.65% |
| ⚡ | Simulation | long body |
382.1 µs | 333.4 µs | +14.61% |
| ... | ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing cod-2720-bump-instrument-hooks-in-codspeed-node-to-support-macos (d7cdf16) with main (4dae798)
Footnotes
-
36 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
f0b1349 to
3982c34
Compare
Add benches/macos.bench.ts guarded with describe.skipIf(!darwin) so it only runs on macOS, and wire the walltime-macos-test CI job to execute it via a direct `node vitest.mjs bench --run macos` invocation.
32c3b31 to
1d75a61
Compare
Greptile SummaryThis PR adds macOS walltime support by emitting paired
Confidence Score: 5/5Safe to merge — the functional changes are correct and the new marker-emission logic handles both sync and async benchmarks without breaking existing behavior. The core logic change (emitting paired BENCHMARK_START/END markers inside codspeed_root_frame) is mechanically sound: timestamps are captured at the right points, the promise-aware path in the vitest plugin correctly passes the fulfillment value through, and the native API surface is properly wired from the submodule through @codspeed/core to both plugins. All previously identified concerns were already flagged in prior review threads and do not introduce runtime regressions. .github/workflows/codspeed.yml warrants a follow-up pass once the sip-resign-exec-redirect runner branch is stabilised, to remove the diagnostic step and pin runner-version to a fixed ref. Important Files Changed
|
| if ( | ||
| result !== null && | ||
| typeof result === "object" && | ||
| typeof (result as PromiseLike<unknown>).then === "function" | ||
| ) { |
There was a problem hiding this comment.
The multi-clause thenable check should be extracted into a named
const per the project's rule that non-obvious or multi-clause boolean conditions must be named with an is*/has* prefix.
| if ( | |
| result !== null && | |
| typeof result === "object" && | |
| typeof (result as PromiseLike<unknown>).then === "function" | |
| ) { | |
| const isThenable = | |
| result !== null && | |
| typeof result === "object" && | |
| typeof (result as PromiseLike<unknown>).then === "function"; | |
| if (isThenable) { |
Rule Used: Extract any non-obvious or multi-clause boolean co... (source)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| // macOS-only benchmark: skipped on every other platform, so it only runs on | ||
| // the `walltime-macos-test` CI job (see .github/workflows/ci.yml). |
There was a problem hiding this comment.
The comment references the removed
walltime-macos-test job in ci.yml. That job was deleted by this PR; the macOS benchmark is now run by codspeed-walltime-macos in .github/workflows/codspeed.yml.
| // macOS-only benchmark: skipped on every other platform, so it only runs on | |
| // the `walltime-macos-test` CI job (see .github/workflows/ci.yml). | |
| // macOS-only benchmark: skipped on every other platform, so it only runs on | |
| // the `codspeed-walltime-macos` CI job (see .github/workflows/codspeed.yml). |
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| - name: Diagnose resign+exec on this runner | ||
| run: | | ||
| sw_vers; uname -m; sysctl -n hw.memsize hw.ncpu | ||
| cp /bin/sh /tmp/sh_copy | ||
| /usr/bin/codesign -s - -f /tmp/sh_copy | ||
| lipo -info /tmp/sh_copy | ||
| /tmp/sh_copy -c 'echo RESIGNED_ARM64E_OK; uname -m' | ||
| echo "exit=$?" |
There was a problem hiding this comment.
Diagnostic step left in production workflow
The "Diagnose resign+exec on this runner" step copies /bin/sh, codesigns it, and re-executes it — this is clearly debugging scaffolding for the SIP/resign investigation. Leaving it in the permanent workflow adds noise to every future CI run and exposes internal implementation details. It should be removed once the resign-exec behaviour is confirmed working.
| working-directory: packages/vitest-plugin | ||
| run: pnpm turbo run bench --env-mode=loose --filter=@codspeed/vitest-plugin | ||
| mode: walltime | ||
| runner-version: branch:sip-resign-exec-redirect |
There was a problem hiding this comment.
Mutable branch reference for
runner-version
runner-version: branch:sip-resign-exec-redirect points to a live branch that can be force-pushed or rebased at any time. If the branch tip changes between two benchmark runs, the profiling behaviour changes silently, making measurement results non-comparable across commits. Consider pinning to a specific commit SHA or tag once the feature branch is stable, e.g. runner-version: sha:<commit>.
No description provided.