-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Profile on start #2354
Profile on start #2354
Conversation
Nice. 👍 |
I believe you could remove the |
@@ -119,6 +119,8 @@ static bool throw_deprecation = false; | |||
static bool abort_on_uncaught_exception = false; | |||
static bool trace_sync_io = false; | |||
static bool track_heap_objects = false; | |||
static bool profile_cpu = false; | |||
static const char* profile_title = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the title is always empty, you might as well drop this variable and use String::Empty()
below.
Left some comments. I think the help section should make it clear that the flag is not related to |
@bnoordhuis did the slight rephrasing help? will need to rebase/squash before pulling in |
@bnoordhuis LGTY? |
@@ -3936,6 +3940,13 @@ static void StartNodeInstance(void* arg) { | |||
Isolate::Scope isolate_scope(isolate); | |||
HandleScope handle_scope(isolate); | |||
Local<Context> context = Context::New(isolate); | |||
|
|||
// CpuProfiler requires HandleScope | |||
// addons can pick up the results with StopProfiling(...) using same title |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please capitalize and punctuate the comment.
@bmeck Can you rebase and squash to a single commit with a commit log conforming to the guidelines from CONTRIBUTING.md? Anyone have thoughts on the name of the switch? I'm partial to |
@bmeck @bnoordhuis ... any further updates on this? @bmeck it would need to be rebased and updated before it could land. |
Closing due to lack of activity or response |
simple way to start the cpu profiler when you application starts up using
--profile-cpu
. useful for applications that need help profiling startup time.