Repository navigation
v8: GetCpuProfiler is going away soon #18039
Description
Activity
- addedc++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.v8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.
on Jan 8, 2018 /cc @nodejs/v8
Hmm.. with the new API it seems that it should be possible to create multiple instances of the CPU profiler. Previously it was a singleton. This means that user-space modules could all use different profilers, and the idle notification above would stop working. Does this mean that Node needs to instantiate a singleton profiler and the ecosystem needs to change to start using that?
Yes, with the old API, every isolate has one profiler assigned, created during
Isolate::Init. With the new API, embedders can create multiple profilers.Node could instantiate a singleton and provide that - or maybe we should invert dependencies: Addons can use as many profilers as they want, but they are responsible for registering for the IdleNotifier.
- added a commit that references this issue
on Feb 2, 2018 Node could instantiate a singleton and provide that - or maybe we should invert dependencies: Addons can use as many profilers as they want, but they are responsible for registering for the IdleNotifier.
I don't think we have to worry about that. We only use it to call
CpuProfiler::SetIdle()and that's not even a proper CpuProfiler method (it updatesv8::internal::Isolate::current_vm_state_.) Add-ons can create their own CpuProfiler instance.I've opened #18534 with a simple fix.
And https://chromium-review.googlesource.com/c/v8/v8/+/900622 to discuss simplifying the API.
- added a commit that references this issue
on Feb 23, 2018 - added a commit that references this issue
on Feb 27, 2018 - added a commit that references this issue
on Mar 7, 2018 - added a commit that references this issue
on May 8, 2018 - added a commit that references this issue
on Jul 27, 2026
A new API was introduced in v8/v8@120b753.
The current API is deprecated in V8 6.4: v8/v8@8c5e2d7
Our usage:
node/src/env.cc
Lines 150 to 160 in 6aac05b