Skip to content
Browse files

Move arg parsing to beginning of main()

For faster "./node -v"
  • Loading branch information...
1 parent d7e220c commit 2337630746d6c7e43a22250042ee997016428720 @ry ry committed
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/node.cc
View
5 src/node.cc
@@ -472,6 +472,9 @@ ParseArgs (int *argc, char **argv)
int
main(int argc, char *argv[])
{
+ ParseArgs(&argc, argv);
+ V8::SetFlagsFromCommandLine(&argc, argv, true);
+
evcom_ignore_sigpipe();
ev_default_loop(EVFLAG_AUTO); // initialize the default ev loop.
@@ -481,8 +484,6 @@ main(int argc, char *argv[])
ev_async_start(EV_DEFAULT_UC_ &eio_watcher);
ev_unref(EV_DEFAULT_UC);
- ParseArgs(&argc, argv);
- V8::SetFlagsFromCommandLine(&argc, argv, true);
V8::Initialize();
V8::SetFatalErrorHandler(OnFatalError);

0 comments on commit 2337630

Please sign in to comment.
Something went wrong with that request. Please try again.