perf_hooks: set bootstrap complete in only one place · nodejs/node@8fddf59
@@ -174,6 +174,8 @@
174174}
175175}
176176177+perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
178+177179// There are various modes that Node can run in. The most common two
178180// are running from a script and running the REPL - but there are a few
179181// others like the debugger or running --eval arguments. Here we decide
@@ -186,7 +188,6 @@
186188// To allow people to extend Node in different ways, this hook allows
187189// one to drop a file lib/_third_party_main.js into the build
188190// directory which will be executed instead of Node's normal loading.
189-perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
190191process.nextTick(function() {
191192perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START);
192193NativeModule.require('_third_party_main');
@@ -200,13 +201,11 @@
200201}
201202202203// Start the debugger agent.
203-perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
204204process.nextTick(function() {
205205NativeModule.require('internal/deps/node-inspect/lib/_inspect').start();
206206});
207207208208} else if (process.profProcess) {
209-perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
210209NativeModule.require('internal/v8_prof_processor');
211210} else {
212211// There is user code to be run.
238237 addBuiltinLibsToObject
239238} = NativeModule.require('internal/modules/cjs/helpers');
240239addBuiltinLibsToObject(global);
241-perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
242240evalScript('[eval]');
243241} else if (process.argv[1] && process.argv[1] !== '-') {
244242perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
@@ -263,7 +261,6 @@
263261checkScriptSyntax(source, filename);
264262process.exit(0);
265263}
266-perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
267264CJSModule.runMain();
268265} else {
269266perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
294291295292if (process._eval != null) {
296293// User passed '-e' or '--eval'
297-perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
298294evalScript('[eval]');
299295}
300296} else {
@@ -311,14 +307,12 @@
311307checkScriptSyntax(code, '[stdin]');
312308} else {
313309process._eval = code;
314-perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
315310evalScript('[stdin]');
316311}
317312});
318313}
319314}
320315}
321-perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
322316}
323317324318function setupProcessObject() {