perf_hooks: always set bootstrapComplete
PR-URL: https://github.com/nodejs/node/pull/20768 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
This commit is contained in:
parent
becc3ec372
commit
456a8193cb
@ -158,12 +158,12 @@
|
|||||||
// To allow people to extend Node in different ways, this hook allows
|
// To allow people to extend Node in different ways, this hook allows
|
||||||
// one to drop a file lib/_third_party_main.js into the build
|
// one to drop a file lib/_third_party_main.js into the build
|
||||||
// directory which will be executed instead of Node's normal loading.
|
// directory which will be executed instead of Node's normal loading.
|
||||||
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
|
||||||
process.nextTick(function() {
|
process.nextTick(function() {
|
||||||
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START);
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START);
|
||||||
NativeModule.require('_third_party_main');
|
NativeModule.require('_third_party_main');
|
||||||
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END);
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END);
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if (process.argv[1] === 'inspect' || process.argv[1] === 'debug') {
|
} else if (process.argv[1] === 'inspect' || process.argv[1] === 'debug') {
|
||||||
if (process.argv[1] === 'debug') {
|
if (process.argv[1] === 'debug') {
|
||||||
process.emitWarning(
|
process.emitWarning(
|
||||||
@ -172,13 +172,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Start the debugger agent.
|
// Start the debugger agent.
|
||||||
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
|
||||||
process.nextTick(function() {
|
process.nextTick(function() {
|
||||||
NativeModule.require('internal/deps/node-inspect/lib/_inspect').start();
|
NativeModule.require('internal/deps/node-inspect/lib/_inspect').start();
|
||||||
});
|
});
|
||||||
|
|
||||||
} else if (process.profProcess) {
|
} else if (process.profProcess) {
|
||||||
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
|
||||||
NativeModule.require('internal/v8_prof_processor');
|
NativeModule.require('internal/v8_prof_processor');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// There is user code to be run.
|
// There is user code to be run.
|
||||||
|
|
||||||
@ -209,6 +210,7 @@
|
|||||||
addBuiltinLibsToObject
|
addBuiltinLibsToObject
|
||||||
} = NativeModule.require('internal/modules/cjs/helpers');
|
} = NativeModule.require('internal/modules/cjs/helpers');
|
||||||
addBuiltinLibsToObject(global);
|
addBuiltinLibsToObject(global);
|
||||||
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
|
||||||
evalScript('[eval]');
|
evalScript('[eval]');
|
||||||
} else if (process.argv[1] && process.argv[1] !== '-') {
|
} else if (process.argv[1] && process.argv[1] !== '-') {
|
||||||
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
|
||||||
@ -233,6 +235,7 @@
|
|||||||
checkScriptSyntax(source, filename);
|
checkScriptSyntax(source, filename);
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
}
|
}
|
||||||
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
|
||||||
CJSModule.runMain();
|
CJSModule.runMain();
|
||||||
} else {
|
} else {
|
||||||
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
|
||||||
@ -263,6 +266,7 @@
|
|||||||
|
|
||||||
if (process._eval != null) {
|
if (process._eval != null) {
|
||||||
// User passed '-e' or '--eval'
|
// User passed '-e' or '--eval'
|
||||||
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
|
||||||
evalScript('[eval]');
|
evalScript('[eval]');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -279,6 +283,7 @@
|
|||||||
checkScriptSyntax(code, '[stdin]');
|
checkScriptSyntax(code, '[stdin]');
|
||||||
} else {
|
} else {
|
||||||
process._eval = code;
|
process._eval = code;
|
||||||
|
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
|
||||||
evalScript('[stdin]');
|
evalScript('[stdin]');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -74,7 +74,7 @@ checkNodeTiming({
|
|||||||
duration: { around: performance.now() },
|
duration: { around: performance.now() },
|
||||||
nodeStart: { around: 0 },
|
nodeStart: { around: 0 },
|
||||||
v8Start: { around: 0 },
|
v8Start: { around: 0 },
|
||||||
bootstrapComplete: -1,
|
bootstrapComplete: { around: inited },
|
||||||
environment: { around: 0 },
|
environment: { around: 0 },
|
||||||
loopStart: -1,
|
loopStart: -1,
|
||||||
loopExit: -1,
|
loopExit: -1,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user