◐ Shell
clean mode source ↗

perf_hooks: remove less useful bootstrap marks · nodejs/node@a3fd1cd

@@ -68,14 +68,6 @@

6868

const perf = process.binding('performance');

6969

const {

7070

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

7971

} = perf.constants;

80728173

_process.setup_hrtime(_hrtime);

189181

// one to drop a file lib/_third_party_main.js into the build

190182

// directory which will be executed instead of Node's normal loading.

191183

process.nextTick(function() {

192-

perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_START);

193184

NativeModule.require('_third_party_main');

194-

perf.markMilestone(NODE_PERFORMANCE_MILESTONE_THIRD_PARTY_MAIN_END);

195185

});

196186

} else if (process.argv[1] === 'inspect' || process.argv[1] === 'debug') {

197187

if (process.argv[1] === 'debug') {

@@ -214,44 +204,30 @@

214204

// channel. This needs to be done before any user code gets executed

215205

// (including preload modules).

216206

if (process.argv[1] && process.env.NODE_UNIQUE_ID) {

217-

perf.markMilestone(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_START);

218207

const cluster = NativeModule.require('cluster');

219208

cluster._setupWorker();

220-

perf.markMilestone(NODE_PERFORMANCE_MILESTONE_CLUSTER_SETUP_END);

221209

// Make sure it's not accidentally inherited by child processes.

222210

delete process.env.NODE_UNIQUE_ID;

223211

}

224212225213

if (process._eval != null && !process._forceRepl) {

226-

perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);

227-

perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END);

228214

// User passed '-e' or '--eval' arguments to Node without '-i' or

229215

// '--interactive'.

230-231-

perf.markMilestone(

232-

NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START);

233216

preloadModules();

234-

perf.markMilestone(NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END);

235217236218

const {

237219

addBuiltinLibsToObject

238220

} = NativeModule.require('internal/modules/cjs/helpers');

239221

addBuiltinLibsToObject(global);

240222

evalScript('[eval]');

241223

} else if (process.argv[1] && process.argv[1] !== '-') {

242-

perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_START);

243224

// Make process.argv[1] into a full path.

244225

const path = NativeModule.require('path');

245226

process.argv[1] = path.resolve(process.argv[1]);

246227247228

const CJSModule = NativeModule.require('internal/modules/cjs/loader');

248229249-

perf.markMilestone(NODE_PERFORMANCE_MILESTONE_MODULE_LOAD_END);

250-

perf.markMilestone(

251-

NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_START);

252230

preloadModules();

253-

perf.markMilestone(

254-

NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END);

255231

// Check if user passed `-c` or `--check` arguments to Node.

256232

if (process._syntax_check_only != null) {

257233

const fs = NativeModule.require('fs');

@@ -263,13 +239,7 @@

263239

}

264240

CJSModule.runMain();

265241

} 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);

270242

preloadModules();

271-

perf.markMilestone(

272-

NODE_PERFORMANCE_MILESTONE_PRELOAD_MODULE_LOAD_END);

273243

// If -i or --interactive were passed, or stdin is a TTY.

274244

if (process._forceRepl || NativeModule.require('tty').isatty(0)) {

275245

// REPL