diff options
author | James M Snell <jasnell@gmail.com> | 2018-06-03 16:58:48 -0700 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2018-06-15 09:05:19 -0700 |
commit | b55f6a0f010da7f2f812b0956283a1d58ebe1ff1 (patch) | |
tree | 23d797e24b5b28ee26356ed7d36e5c1d2d5383c0 /lib | |
parent | 17e378b51a4e35533b43bae66e7aa76faaad17b3 (diff) | |
download | android-node-v8-b55f6a0f010da7f2f812b0956283a1d58ebe1ff1.tar.gz android-node-v8-b55f6a0f010da7f2f812b0956283a1d58ebe1ff1.tar.bz2 android-node-v8-b55f6a0f010da7f2f812b0956283a1d58ebe1ff1.zip |
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>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/internal/bootstrap/node.js | 30 | ||||
-rw-r--r-- | lib/perf_hooks.js | 47 |
2 files changed, 1 insertions, 76 deletions
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 7b836b466f..a1162d384a 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -68,14 +68,6 @@ const perf = process.binding('performance'); const { 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; _process.setup_hrtime(_hrtime); @@ -189,9 +181,7 @@ // one to drop a file lib/_third_party_main.js into the build // directory which will be executed instead of Node's normal loading. process.nextTick(function() { - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START); NativeModule.require('_third_party_main'); - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END); }); } else if (process.argv[1] === 'inspect' || 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 // (including preload modules). if (process.argv[1] && process.env.NODE_UNIQUE_ID) { - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START); const cluster = NativeModule.require('cluster'); cluster._setupWorker(); - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END); // Make sure it's not accidentally inherited by child processes. delete process.env.NODE_UNIQUE_ID; } 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 // '--interactive'. - - perf.markMilestone( - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START); preloadModules(); - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END); const { addBuiltinLibsToObject @@ -239,19 +221,13 @@ addBuiltinLibsToObject(global); evalScript('[eval]'); } else if (process.argv[1] && process.argv[1] !== '-') { - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START); // Make process.argv[1] into a full path. const path = NativeModule.require('path'); process.argv[1] = path.resolve(process.argv[1]); 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(); - perf.markMilestone( - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END); // Check if user passed `-c` or `--check` arguments to Node. if (process._syntax_check_only != null) { const fs = NativeModule.require('fs'); @@ -263,13 +239,7 @@ } CJSModule.runMain(); } 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(); - perf.markMilestone( - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END); // If -i or --interactive were passed, or stdin is a TTY. if (process._forceRepl || NativeModule.require('tty').isatty(0)) { // REPL diff --git a/lib/perf_hooks.js b/lib/perf_hooks.js index 9080cc7f26..f7b18816e6 100644 --- a/lib/perf_hooks.js +++ b/lib/perf_hooks.js @@ -27,15 +27,7 @@ const { NODE_PERFORMANCE_MILESTONE_LOOP_START, NODE_PERFORMANCE_MILESTONE_LOOP_EXIT, NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE, - 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 + NODE_PERFORMANCE_MILESTONE_ENVIRONMENT } = constants; const { AsyncResource } = require('async_hooks'); @@ -192,43 +184,6 @@ class PerformanceNodeTiming { 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]() { return { name: 'node', |