GeezerVison is showing github.com — perf_hooks: remove less useful bootstrap marks · nodejs/node@a3fd1cd
File treeExpand file treeCollapse file tree Open diff view settings Expand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: doc/api/perf_hooks.md -78Lines changed: 0 additions & 78 deletions - Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|
@@ -219,26 +219,6 @@ The high resolution millisecond timestamp at which the Node.js process | 219 | 219 | completed bootstrapping. If bootstrapping has not yet finished, the property | 220 | 220 | has the value of -1. | 221 | 221 |
| 222 | | -### performanceNodeTiming.clusterSetupEnd | 223 | | -<!-- YAML | 224 | | -added: v8.5.0 | 225 | | ---> | 226 | | - | 227 | | -* {number} | 228 | | - | 229 | | -The high resolution millisecond timestamp at which cluster processing ended. If | 230 | | -cluster processing has not yet ended, the property has the value of -1. | 231 | | - | 232 | | -### performanceNodeTiming.clusterSetupStart | 233 | | -<!-- YAML | 234 | | -added: v8.5.0 | 235 | | ---> | 236 | | - | 237 | | -* {number} | 238 | | - | 239 | | -The high resolution millisecond timestamp at which cluster processing started. | 240 | | -If cluster processing has not yet started, the property has the value of -1. | 241 | | - | 242 | 222 | ### performanceNodeTiming.loopExit | 243 | 223 | <!-- YAML | 244 | 224 | added: v8.5.0 | @@ -261,24 +241,6 @@ The high resolution millisecond timestamp at which the Node.js event loop | 261 | 241 | started. If the event loop has not yet started (e.g., in the first tick of the | 262 | 242 | main script), the property has the value of -1. | 263 | 243 |
| 264 | | -### performanceNodeTiming.moduleLoadEnd | 265 | | -<!-- YAML | 266 | | -added: v8.5.0 | 267 | | ---> | 268 | | - | 269 | | -* {number} | 270 | | - | 271 | | -The high resolution millisecond timestamp at which main module load ended. | 272 | | - | 273 | | -### performanceNodeTiming.moduleLoadStart | 274 | | -<!-- YAML | 275 | | -added: v8.5.0 | 276 | | ---> | 277 | | - | 278 | | -* {number} | 279 | | - | 280 | | -The high resolution millisecond timestamp at which main module load started. | 281 | | - | 282 | 244 | ### performanceNodeTiming.nodeStart | 283 | 245 | <!-- YAML | 284 | 246 | added: v8.5.0 | @@ -289,46 +251,6 @@ added: v8.5.0 | 289 | 251 | The high resolution millisecond timestamp at which the Node.js process was | 290 | 252 | initialized. | 291 | 253 |
| 292 | | -### performanceNodeTiming.preloadModuleLoadEnd | 293 | | -<!-- YAML | 294 | | -added: v8.5.0 | 295 | | ---> | 296 | | - | 297 | | -* {number} | 298 | | - | 299 | | -The high resolution millisecond timestamp at which preload module load ended. | 300 | | - | 301 | | -### performanceNodeTiming.preloadModuleLoadStart | 302 | | -<!-- YAML | 303 | | -added: v8.5.0 | 304 | | ---> | 305 | | - | 306 | | -* {number} | 307 | | - | 308 | | -The high resolution millisecond timestamp at which preload module load started. | 309 | | - | 310 | | -### performanceNodeTiming.thirdPartyMainEnd | 311 | | -<!-- YAML | 312 | | -added: v8.5.0 | 313 | | ---> | 314 | | - | 315 | | -* {number} | 316 | | - | 317 | | -The high resolution millisecond timestamp at which third\_party\_main | 318 | | -processing ended. If third\_party\_main processing has not yet ended, the | 319 | | -property has the value of -1. | 320 | | - | 321 | | -### performanceNodeTiming.thirdPartyMainStart | 322 | | -<!-- YAML | 323 | | -added: v8.5.0 | 324 | | ---> | 325 | | - | 326 | | -* {number} | 327 | | - | 328 | | -The high resolution millisecond timestamp at which third\_party\_main | 329 | | -processing started. If third\_party\_main processing has not yet started, the | 330 | | -property has the value of -1. | 331 | | - | 332 | 254 | ### performanceNodeTiming.v8Start | 333 | 255 | <!-- YAML | 334 | 256 | added: v8.5.0 | |
Collapse file Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js -30Lines changed: 0 additions & 30 deletions | Original file line number | Diff line number | Diff line change |
|---|
| 68 | 68 | const perf = process.binding('performance'); | 69 | 69 | const { | 70 | 70 | NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE, | 71 | | - NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START, | 72 | | - NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END, | 73 | | - NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START, | 74 | | - NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END, | 75 | | - NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START, | 76 | | - NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END, | 77 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START, | 78 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END | 79 | 71 | } = perf.constants; | 80 | 72 |
| 81 | 73 | _process.setup_hrtime(_hrtime); | | 189 | 181 | // one to drop a file lib/_third_party_main.js into the build | 190 | 182 | // directory which will be executed instead of Node's normal loading. | 191 | 183 | process.nextTick(function() { | 192 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START); | 193 | 184 | NativeModule.require('_third_party_main'); | 194 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END); | 195 | 185 | }); | 196 | 186 | } else if (process.argv[1] === 'inspect' || process.argv[1] === 'debug') { | 197 | 187 | if (process.argv[1] === 'debug') { | | 214 | 204 | // channel. This needs to be done before any user code gets executed | 215 | 205 | // (including preload modules). | 216 | 206 | if (process.argv[1] && process.env.NODE_UNIQUE_ID) { | 217 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START); | 218 | 207 | const cluster = NativeModule.require('cluster'); | 219 | 208 | cluster._setupWorker(); | 220 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END); | 221 | 209 | // Make sure it's not accidentally inherited by child processes. | 222 | 210 | delete process.env.NODE_UNIQUE_ID; | 223 | 211 | } | 224 | 212 |
| 225 | 213 | if (process._eval != null && !process._forceRepl) { | 226 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START); | 227 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END); | 228 | 214 | // User passed '-e' or '--eval' arguments to Node without '-i' or | 229 | 215 | // '--interactive'. | 230 | | - | 231 | | - perf.markMilestone( | 232 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START); | 233 | 216 | preloadModules(); | 234 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END); | 235 | 217 |
| 236 | 218 | const { | 237 | 219 | addBuiltinLibsToObject | 238 | 220 | } = NativeModule.require('internal/modules/cjs/helpers'); | 239 | 221 | addBuiltinLibsToObject(global); | 240 | 222 | evalScript('[eval]'); | 241 | 223 | } else if (process.argv[1] && process.argv[1] !== '-') { | 242 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START); | 243 | 224 | // Make process.argv[1] into a full path. | 244 | 225 | const path = NativeModule.require('path'); | 245 | 226 | process.argv[1] = path.resolve(process.argv[1]); | 246 | 227 |
| 247 | 228 | const CJSModule = NativeModule.require('internal/modules/cjs/loader'); | 248 | 229 |
| 249 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END); | 250 | | - perf.markMilestone( | 251 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START); | 252 | 230 | preloadModules(); | 253 | | - perf.markMilestone( | 254 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END); | 255 | 231 | // Check if user passed `-c` or `--check` arguments to Node. | 256 | 232 | if (process._syntax_check_only != null) { | 257 | 233 | const fs = NativeModule.require('fs'); | | 263 | 239 | } | 264 | 240 | CJSModule.runMain(); | 265 | 241 | } else { | 266 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START); | 267 | | - perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END); | 268 | | - perf.markMilestone( | 269 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START); | 270 | 242 | preloadModules(); | 271 | | - perf.markMilestone( | 272 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END); | 273 | 243 | // If -i or --interactive were passed, or stdin is a TTY. | 274 | 244 | if (process._forceRepl || NativeModule.require('tty').isatty(0)) { | 275 | 245 | // REPL | |
Collapse file Copy file name to clipboardExpand all lines: lib/perf_hooks.js +1-46Lines changed: 1 addition & 46 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -27,15 +27,7 @@ const { | 27 | 27 | NODE_PERFORMANCE_MILESTONE_LOOP_START, | 28 | 28 | NODE_PERFORMANCE_MILESTONE_LOOP_EXIT, | 29 | 29 | NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE, | 30 | | - NODE_PERFORMANCE_MILESTONE_ENVIRONMENT, | 31 | | - NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START, | 32 | | - NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END, | 33 | | - NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START, | 34 | | - NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END, | 35 | | - NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START, | 36 | | - NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END, | 37 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START, | 38 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END | | 30 | + NODE_PERFORMANCE_MILESTONE_ENVIRONMENT | 39 | 31 | } = constants; | 40 | 32 |
| 41 | 33 | const { AsyncResource } = require('async_hooks'); | @@ -192,43 +184,6 @@ class PerformanceNodeTiming { | 192 | 184 | return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE); | 193 | 185 | } | 194 | 186 |
| 195 | | - get thirdPartyMainStart() { | 196 | | - return getMilestoneTimestamp( | 197 | | - NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START); | 198 | | - } | 199 | | - | 200 | | - get thirdPartyMainEnd() { | 201 | | - return getMilestoneTimestamp( | 202 | | - NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END); | 203 | | - } | 204 | | - | 205 | | - get clusterSetupStart() { | 206 | | - return getMilestoneTimestamp( | 207 | | - NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START); | 208 | | - } | 209 | | - | 210 | | - get clusterSetupEnd() { | 211 | | - return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END); | 212 | | - } | 213 | | - | 214 | | - get moduleLoadStart() { | 215 | | - return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START); | 216 | | - } | 217 | | - | 218 | | - get moduleLoadEnd() { | 219 | | - return getMilestoneTimestamp(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END); | 220 | | - } | 221 | | - | 222 | | - get preloadModuleLoadStart() { | 223 | | - return getMilestoneTimestamp( | 224 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START); | 225 | | - } | 226 | | - | 227 | | - get preloadModuleLoadEnd() { | 228 | | - return getMilestoneTimestamp( | 229 | | - NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END); | 230 | | - } | 231 | | - | 232 | 187 | [kInspect]() { | 233 | 188 | return { | 234 | 189 | name: 'node', | |
Collapse file Copy file name to clipboardExpand all lines: src/node_perf_common.h +2-9Lines changed: 2 additions & 9 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -24,15 +24,8 @@ extern uint64_t performance_v8_start; | 24 | 24 | V(V8_START, "v8Start") \ | 25 | 25 | V(LOOP_START, "loopStart") \ | 26 | 26 | V(LOOP_EXIT, "loopExit") \ | 27 | | - V(BOOTSTRAP_COMPLETE, "bootstrapComplete") \ | 28 | | - V(THIRD_PARTY_MAIN_START, "thirdPartyMainStart") \ | 29 | | - V(THIRD_PARTY_MAIN_END, "thirdPartyMainEnd") \ | 30 | | - V(CLUSTER_SETUP_START, "clusterSetupStart") \ | 31 | | - V(CLUSTER_SETUP_END, "clusterSetupEnd") \ | 32 | | - V(MODULE_LOAD_START, "moduleLoadStart") \ | 33 | | - V(MODULE_LOAD_END, "moduleLoadEnd") \ | 34 | | - V(PRELOAD_MODULE_LOAD_START, "preloadModulesLoadStart") \ | 35 | | - V(PRELOAD_MODULE_LOAD_END, "preloadModulesLoadEnd") | | 27 | + V(BOOTSTRAP_COMPLETE, "bootstrapComplete") | | 28 | + | 36 | 29 |
| 37 | 30 | #define NODE_PERFORMANCE_ENTRY_TYPES(V) \ | 38 | 31 | V(NODE, "node") \ | |
Collapse file Copy file name to clipboardExpand all lines: test/sequential/test-performance.js +3-27Lines changed: 3 additions & 27 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -80,15 +80,7 @@ checkNodeTiming({ | 80 | 80 | bootstrapComplete: { around: inited }, | 81 | 81 | environment: { around: 0 }, | 82 | 82 | loopStart: -1, | 83 | | - loopExit: -1, | 84 | | - thirdPartyMainStart: -1, | 85 | | - thirdPartyMainEnd: -1, | 86 | | - clusterSetupStart: -1, | 87 | | - clusterSetupEnd: -1, | 88 | | - moduleLoadStart: { around: inited }, | 89 | | - moduleLoadEnd: { around: inited }, | 90 | | - preloadModuleLoadStart: { around: inited }, | 91 | | - preloadModuleLoadEnd: { around: inited }, | | 83 | + loopExit: -1 | 92 | 84 | }); | 93 | 85 |
| 94 | 86 | setTimeout(() => { | @@ -102,15 +94,7 @@ setTimeout(() => { | 102 | 94 | bootstrapComplete: { around: inited }, | 103 | 95 | environment: { around: 0 }, | 104 | 96 | loopStart: { around: inited }, | 105 | | - loopExit: -1, | 106 | | - thirdPartyMainStart: -1, | 107 | | - thirdPartyMainEnd: -1, | 108 | | - clusterSetupStart: -1, | 109 | | - clusterSetupEnd: -1, | 110 | | - moduleLoadStart: { around: inited }, | 111 | | - moduleLoadEnd: { around: inited }, | 112 | | - preloadModuleLoadStart: { around: inited }, | 113 | | - preloadModuleLoadEnd: { around: inited }, | | 97 | + loopExit: -1 | 114 | 98 | }); | 115 | 99 | }, 2000); | 116 | 100 |
| @@ -125,14 +109,6 @@ process.on('exit', () => { | 125 | 109 | bootstrapComplete: { around: inited }, | 126 | 110 | environment: { around: 0 }, | 127 | 111 | loopStart: { around: inited }, | 128 | | - loopExit: { around: performance.now() }, | 129 | | - thirdPartyMainStart: -1, | 130 | | - thirdPartyMainEnd: -1, | 131 | | - clusterSetupStart: -1, | 132 | | - clusterSetupEnd: -1, | 133 | | - moduleLoadStart: { around: inited }, | 134 | | - moduleLoadEnd: { around: inited }, | 135 | | - preloadModuleLoadStart: { around: inited }, | 136 | | - preloadModuleLoadEnd: { around: inited }, | | 112 | + loopExit: { around: performance.now() } | 137 | 113 | }); | 138 | 114 | }); |
|