Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d370306

Browse filesBrowse files
evanlucasFishrock123
authored andcommitted
src: only set v8 flags if argc > 1
ParseArgs sets the first element of v8_args to argv[0], so v8_argc will always be at least 1. This change only calls V8::SetFlagsFromCommandLine if v8_argc > 1, leading to an additional startup improvement of ~5%. PR-URL: #2646 Reviewed-By: trevnorris - Trevor Norris <trev.norris@gmail.com>
1 parent b09634a commit d370306
Copy full SHA for d370306

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Open diff view settings
Collapse file

‎src/node.cc‎

Copy file name to clipboardExpand all lines: src/node.cc
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3688,7 +3688,7 @@ void Init(int* argc,
36883688
#endif
36893689
// The const_cast doesn't violate conceptual const-ness. V8 doesn't modify
36903690
// the argv array or the elements it points to.
3691-
if (v8_argc != 0)
3691+
if (v8_argc > 1)
36923692
V8::SetFlagsFromCommandLine(&v8_argc, const_cast<char**>(v8_argv), true);
36933693

36943694
// Anything that's still in v8_argv is not a V8 or a node option.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.