consider reintroduce perf-prof support for macOS

Open
#652 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
28/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, node.js, rust

Research direction

Start by reviewing the V8 change that removed perf-prof support and the referenced Node.js v8-perf-maps patch, then compare how macOS jitdump support works in JavaScriptCore and SpiderMonkey. Done means establishing whether Node.js can reintroduce macOS perf-prof support so mixed Rust and JavaScript profiles can be analyzed with samply.

Written by the indexing model from the issue text.

Description

I'm a maintainer of Rspack, and one of our major challenges is identifying performance bottlenecks in user projects during the build process.

Rspack extensively utilizes node-api, resulting in frequent Rust-JavaScript communication (we support JS loaders and plugins via node-api). Currently, we use cpu-profile to debug JavaScript performance issues and samply for Rust performance issues. However, bottlenecks often span both Rust and JavaScript, making it difficult to analyze using two separate profiling tools.

I recently discovered that samply supports jitdump, which can remap native frames to JavaScript frames, allowing us to analyze performance within a single tool. Unfortunately, Node.js only supports perf-prof on Linux. While debugging on Linux is possible, it's not ideal since most of our internal developers use macOS, and it's impractical to ask users to install Linux solely for generating these profiles.

Upon investigation, I found that perf-prof support was removed in V8 to fix fuzzer tests (https://chromium-review.googlesource.com/c/v8/v8/+/1993969). However, Node.js can support perf-prof with a minor patch. Although the patch isn't perfect, it demonstrates that macOS support is still feasible.

Both JavaScriptCore and SpiderMonkey support jitdump on macOS. I'm wondering if Node.js could reintroduce perf-prof support for macOS, as it would be incredibly useful for profiling JavaScript compiler tools that heavily rely on node-api, such as Rspack, Rolldown, Next.js, SWC and others.

Dominant language
No language data
Stars
550
Forks
69
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from nodejs/diagnostics

All issues in nodejs/diagnostics

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.