Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2e99576

Browse filesBrowse files
jasnellMylesBorins
authored andcommitted
perf_hooks: always set bootstrapComplete
PR-URL: #20768 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 22f46e7 commit 2e99576
Copy full SHA for 2e99576

File tree

Expand file treeCollapse file tree

2 files changed

+8
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

2 files changed

+8
-3
lines changed
Open diff view settings
Collapse file

‎lib/internal/bootstrap/node.js‎

Copy file name to clipboardExpand all lines: lib/internal/bootstrap/node.js
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,12 +157,12 @@
157157
// To allow people to extend Node in different ways, this hook allows
158158
// one to drop a file lib/_third_party_main.js into the build
159159
// directory which will be executed instead of Node's normal loading.
160+
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
160161
process.nextTick(function() {
161162
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START);
162163
NativeModule.require('_third_party_main');
163164
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END);
164165
});
165-
166166
} else if (process.argv[1] === 'inspect' || process.argv[1] === 'debug') {
167167
if (process.argv[1] === 'debug') {
168168
process.emitWarning(
@@ -171,13 +171,14 @@
171171
}
172172

173173
// Start the debugger agent.
174+
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
174175
process.nextTick(function() {
175176
NativeModule.require('internal/deps/node-inspect/lib/_inspect').start();
176177
});
177178

178179
} else if (process.profProcess) {
180+
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
179181
NativeModule.require('internal/v8_prof_processor');
180-
181182
} else {
182183
// There is user code to be run.
183184

@@ -208,6 +209,7 @@
208209
addBuiltinLibsToObject
209210
} = NativeModule.require('internal/modules/cjs/helpers');
210211
addBuiltinLibsToObject(global);
212+
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
211213
evalScript('[eval]');
212214
} else if (process.argv[1] && process.argv[1] !== '-') {
213215
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
@@ -232,6 +234,7 @@
232234
checkScriptSyntax(source, filename);
233235
process.exit(0);
234236
}
237+
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
235238
CJSModule.runMain();
236239
} else {
237240
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);
@@ -262,6 +265,7 @@
262265

263266
if (process._eval != null) {
264267
// User passed '-e' or '--eval'
268+
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
265269
evalScript('[eval]');
266270
}
267271
} else {
@@ -278,6 +282,7 @@
278282
checkScriptSyntax(code, '[stdin]');
279283
} else {
280284
process._eval = code;
285+
perf.markMilestone(NODE_PERFORMANCE_MILESTONE_BOOTSTRAP_COMPLETE);
281286
evalScript('[stdin]');
282287
}
283288
});
Collapse file

‎test/sequential/test-performance.js‎

Copy file name to clipboardExpand all lines: test/sequential/test-performance.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ checkNodeTiming({
7474
duration: { around: performance.now() },
7575
nodeStart: { around: 0 },
7676
v8Start: { around: 0 },
77-
bootstrapComplete: -1,
77+
bootstrapComplete: { around: inited },
7878
environment: { around: 0 },
7979
loopStart: -1,
8080
loopExit: -1,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.