Dig Deep V8 profiling
summary
Builds a native Node.js add-on with node-gyp and uses the V8 CPU profiler API to start/stop sampling from C++, sets the sampling interval (defaults to 1 ms), and prints a top‑down tree of frames by walking the profile nodes. The demo compiles the addon, runs a tight JSON.stringify workload, and shows the profiler accruing about 312 samples for the hot function, a background thread receiving samples, and a C++ printer that successfully outputs the profile.
AI-written summary · about
chapters (6)
- 0:00Start
- 0:51Documentation
- 6:06Creating a Handle Scope
- 7:15Headers
- 9:03Start Profiling
- 14:35Cpu Profile Node
related talks
28mPerformance Profiling for V8
23mJoin the super secret V8 club & become a JavaScriptbender
01h 02mProfiling Node Applications
28mWriting node modules with v8
25mIntroduction to native extensions
32mV8 by example: A journey through the compilation pipeline
28mMemory Profiling for Mere Mortals
29mProfiling Node Applications
