perf_hooks: remove less useful bootstrap marks

While `perf_hooks` is still in experimental, remove less useful
bootstrap milestones.

PR-URL: https://github.com/nodejs/node/pull/21247
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
This commit is contained in:
James M Snell 2018-06-03 16:58:48 -07:00 коммит произвёл Michaël Zasso
Родитель 8fddf591c5
Коммит a3fd1cd8ea
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 770F7A9A5AE15600
5 изменённых файлов: 6 добавлений и 190 удалений

Просмотреть файл

@ -219,26 +219,6 @@ The high resolution millisecond timestamp at which the Node.js process
completed bootstrapping. If bootstrapping has not yet finished, the property completed bootstrapping. If bootstrapping has not yet finished, the property
has the value of -1. has the value of -1.
### performanceNodeTiming.clusterSetupEnd
<!-- YAML
added: v8.5.0
-->
* {number}
The high resolution millisecond timestamp at which cluster processing ended. If
cluster processing has not yet ended, the property has the value of -1.
### performanceNodeTiming.clusterSetupStart
<!-- YAML
added: v8.5.0
-->
* {number}
The high resolution millisecond timestamp at which cluster processing started.
If cluster processing has not yet started, the property has the value of -1.
### performanceNodeTiming.loopExit ### performanceNodeTiming.loopExit
<!-- YAML <!-- YAML
added: v8.5.0 added: v8.5.0
@ -261,24 +241,6 @@ The high resolution millisecond timestamp at which the Node.js event loop
started. If the event loop has not yet started (e.g., in the first tick of the started. If the event loop has not yet started (e.g., in the first tick of the
main script), the property has the value of -1. main script), the property has the value of -1.
### performanceNodeTiming.moduleLoadEnd
<!-- YAML
added: v8.5.0
-->
* {number}
The high resolution millisecond timestamp at which main module load ended.
### performanceNodeTiming.moduleLoadStart
<!-- YAML
added: v8.5.0
-->
* {number}
The high resolution millisecond timestamp at which main module load started.
### performanceNodeTiming.nodeStart ### performanceNodeTiming.nodeStart
<!-- YAML <!-- YAML
added: v8.5.0 added: v8.5.0
@ -289,46 +251,6 @@ added: v8.5.0
The high resolution millisecond timestamp at which the Node.js process was The high resolution millisecond timestamp at which the Node.js process was
initialized. initialized.
### performanceNodeTiming.preloadModuleLoadEnd
<!-- YAML
added: v8.5.0
-->
* {number}
The high resolution millisecond timestamp at which preload module load ended.
### performanceNodeTiming.preloadModuleLoadStart
<!-- YAML
added: v8.5.0
-->
* {number}
The high resolution millisecond timestamp at which preload module load started.
### performanceNodeTiming.thirdPartyMainEnd
<!-- YAML
added: v8.5.0
-->
* {number}
The high resolution millisecond timestamp at which third\_party\_main
processing ended. If third\_party\_main processing has not yet ended, the
property has the value of -1.
### performanceNodeTiming.thirdPartyMainStart
<!-- YAML
added: v8.5.0
-->
* {number}
The high resolution millisecond timestamp at which third\_party\_main
processing started. If third\_party\_main processing has not yet started, the
property has the value of -1.
### performanceNodeTiming.v8Start ### performanceNodeTiming.v8Start
<!-- YAML <!-- YAML
added: v8.5.0 added: v8.5.0

Просмотреть файл

@ -68,14 +68,6 @@
const perf = process.binding('performance'); const perf = process.binding('performance');
const { const {
NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE, NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE,
NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START,
NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END,
NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START,
NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END,
NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START,
NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END,
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START,
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END
} = perf.constants; } = perf.constants;
_process.setup_hrtime(_hrtime); _process.setup_hrtime(_hrtime);
@ -189,9 +181,7 @@
// 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.
process.nextTick(function() { process.nextTick(function() {
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);
}); });
} 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') {
@ -214,24 +204,16 @@
// channel. This needs to be done before any user code gets executed // channel. This needs to be done before any user code gets executed
// (including preload modules). // (including preload modules).
if (process.argv[1] && process.env.NODE_UNIQUE_ID) { if (process.argv[1] && process.env.NODE_UNIQUE_ID) {
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START);
const cluster = NativeModule.require('cluster'); const cluster = NativeModule.require('cluster');
cluster._setupWorker(); cluster._setupWorker();
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END);
// Make sure it's not accidentally inherited by child processes. // Make sure it's not accidentally inherited by child processes.
delete process.env.NODE_UNIQUE_ID; delete process.env.NODE_UNIQUE_ID;
} }
if (process._eval != null && !process._forceRepl) { if (process._eval != null && !process._forceRepl) {
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END);
// User passed '-e' or '--eval' arguments to Node without '-i' or // User passed '-e' or '--eval' arguments to Node without '-i' or
// '--interactive'. // '--interactive'.
perf.markMilestone(
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START);
preloadModules(); preloadModules();
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END);
const { const {
addBuiltinLibsToObject addBuiltinLibsToObject
@ -239,19 +221,13 @@
addBuiltinLibsToObject(global); addBuiltinLibsToObject(global);
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);
// Make process.argv[1] into a full path. // Make process.argv[1] into a full path.
const path = NativeModule.require('path'); const path = NativeModule.require('path');
process.argv[1] = path.resolve(process.argv[1]); process.argv[1] = path.resolve(process.argv[1]);
const CJSModule = NativeModule.require('internal/modules/cjs/loader'); const CJSModule = NativeModule.require('internal/modules/cjs/loader');
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END);
perf.markMilestone(
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START);
preloadModules(); preloadModules();
perf.markMilestone(
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END);
// Check if user passed `-c` or `--check` arguments to Node. // Check if user passed `-c` or `--check` arguments to Node.
if (process._syntax_check_only != null) { if (process._syntax_check_only != null) {
const fs = NativeModule.require('fs'); const fs = NativeModule.require('fs');
@ -263,13 +239,7 @@
} }
CJSModule.runMain(); CJSModule.runMain();
} else { } else {
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END);
perf.markMilestone(
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START);
preloadModules(); preloadModules();
perf.markMilestone(
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END);
// If -i or --interactive were passed, or stdin is a TTY. // If -i or --interactive were passed, or stdin is a TTY.
if (process._forceRepl || NativeModule.require('tty').isatty(0)) { if (process._forceRepl || NativeModule.require('tty').isatty(0)) {
// REPL // REPL

Просмотреть файл

@ -27,15 +27,7 @@ const {
NODE_PERFORMANCE_MILESTONE_LOOP_START, NODE_PERFORMANCE_MILESTONE_LOOP_START,
NODE_PERFORMANCE_MILESTONE_LOOP_EXIT, NODE_PERFORMANCE_MILESTONE_LOOP_EXIT,
NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE, NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE,
NODE_PERFORMANCE_MILESTONE_ENVIRONMENT, NODE_PERFORMANCE_MILESTONE_ENVIRONMENT
NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START,
NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END,
NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START,
NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END,
NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START,
NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END,
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START,
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END
} = constants; } = constants;
const { AsyncResource } = require('async_hooks'); const { AsyncResource } = require('async_hooks');
@ -192,43 +184,6 @@ class PerformanceNodeTiming {
return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
} }
get thirdPartyMainStart() {
return getMilestoneTimestamp(
NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START);
}
get thirdPartyMainEnd() {
return getMilestoneTimestamp(
NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END);
}
get clusterSetupStart() {
return getMilestoneTimestamp(
NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START);
}
get clusterSetupEnd() {
return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END);
}
get moduleLoadStart() {
return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
}
get moduleLoadEnd() {
return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END);
}
get preloadModuleLoadStart() {
return getMilestoneTimestamp(
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START);
}
get preloadModuleLoadEnd() {
return getMilestoneTimestamp(
NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END);
}
[kInspect]() { [kInspect]() {
return { return {
name: 'node', name: 'node',

Просмотреть файл

@ -24,15 +24,8 @@ extern uint64_t performance_v8_start;
V(V8_START, "v8Start") \ V(V8_START, "v8Start") \
V(LOOP_START, "loopStart") \ V(LOOP_START, "loopStart") \
V(LOOP_EXIT, "loopExit") \ V(LOOP_EXIT, "loopExit") \
V(BOOTSTRAP_COMPLETE, "bootstrapComplete") \ V(BOOTSTRAP_COMPLETE, "bootstrapComplete")
V(THIRD_PARTY_MAIN_START, "thirdPartyMainStart") \
V(THIRD_PARTY_MAIN_END, "thirdPartyMainEnd") \
V(CLUSTER_SETUP_START, "clusterSetupStart") \
V(CLUSTER_SETUP_END, "clusterSetupEnd") \
V(MODULE_LOAD_START, "moduleLoadStart") \
V(MODULE_LOAD_END, "moduleLoadEnd") \
V(PRELOAD_MODULE_LOAD_START, "preloadModulesLoadStart") \
V(PRELOAD_MODULE_LOAD_END, "preloadModulesLoadEnd")
#define NODE_PERFORMANCE_ENTRY_TYPES(V) \ #define NODE_PERFORMANCE_ENTRY_TYPES(V) \
V(NODE, "node") \ V(NODE, "node") \

Просмотреть файл

@ -80,15 +80,7 @@ checkNodeTiming({
bootstrapComplete: { around: inited }, bootstrapComplete: { around: inited },
environment: { around: 0 }, environment: { around: 0 },
loopStart: -1, loopStart: -1,
loopExit: -1, loopExit: -1
thirdPartyMainStart: -1,
thirdPartyMainEnd: -1,
clusterSetupStart: -1,
clusterSetupEnd: -1,
moduleLoadStart: { around: inited },
moduleLoadEnd: { around: inited },
preloadModuleLoadStart: { around: inited },
preloadModuleLoadEnd: { around: inited },
}); });
setTimeout(() => { setTimeout(() => {
@ -102,15 +94,7 @@ setTimeout(() => {
bootstrapComplete: { around: inited }, bootstrapComplete: { around: inited },
environment: { around: 0 }, environment: { around: 0 },
loopStart: { around: inited }, loopStart: { around: inited },
loopExit: -1, loopExit: -1
thirdPartyMainStart: -1,
thirdPartyMainEnd: -1,
clusterSetupStart: -1,
clusterSetupEnd: -1,
moduleLoadStart: { around: inited },
moduleLoadEnd: { around: inited },
preloadModuleLoadStart: { around: inited },
preloadModuleLoadEnd: { around: inited },
}); });
}, 2000); }, 2000);
@ -125,14 +109,6 @@ process.on('exit', () => {
bootstrapComplete: { around: inited }, bootstrapComplete: { around: inited },
environment: { around: 0 }, environment: { around: 0 },
loopStart: { around: inited }, loopStart: { around: inited },
loopExit: { around: performance.now() }, loopExit: { around: performance.now() }
thirdPartyMainStart: -1,
thirdPartyMainEnd: -1,
clusterSetupStart: -1,
clusterSetupEnd: -1,
moduleLoadStart: { around: inited },
moduleLoadEnd: { around: inited },
preloadModuleLoadStart: { around: inited },
preloadModuleLoadEnd: { around: inited },
}); });
}); });