@vscode/vscode-perf
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -17,6 +17,7 @@ "use strict"; | ||
.option('-m, --duration-markers <duration-markers>', 'pair of markers separated by `-` between which the duration has to be measured. Eg: `code/didLoadWorkbenchMain-code/didLoadExtensions') | ||
.option('--perf-file <perf-file>', 'file in which the performance measurements shall be recorded') | ||
.option('--duration-markers-file <duration-markers-file>', 'file in which the performance measurements shall be recorded') | ||
.option('--folder <folder>', 'folder to open in VSCode while measuring the performance') | ||
.option('--file <file>', 'file to open in VSCode while measuring the performance') | ||
.option('--runs <number-of-runs>', 'number of times to run the performance measurement'); | ||
.option('--runs <number-of-runs>', 'number of times to run the performance measurement') | ||
.addOption(new commander_1.Option('--prof-append-timers <prof-append-timers>').hideHelp(true)); | ||
const opts = commander_1.program.parse(argv).opts(); | ||
@@ -27,6 +28,7 @@ try { | ||
durationMarkers: opts.durationMarkers ? Array.isArray(opts.durationMarkers) ? opts.durationMarkers : [opts.durationMarkers] : undefined, | ||
file: opts.perfFile, | ||
durationMarkersFile: opts.durationMarkersFile, | ||
runs: opts.runs ? parseInt(opts.runs) : undefined, | ||
folderToOpen: opts.folder, | ||
fileToOpen: opts.file | ||
fileToOpen: opts.file, | ||
profAppendTimers: opts.profAppendTimers | ||
}); | ||
@@ -33,0 +35,0 @@ } |
@@ -44,3 +44,3 @@ "use strict"; | ||
fs.mkdirSync(constants_1.ROOT, { recursive: true }); | ||
const perfFile = options.file ?? constants_1.PERFORMANCE_FILE; | ||
const perfFile = options.durationMarkersFile ?? constants_1.PERFORMANCE_FILE; | ||
const codeArgs = [ | ||
@@ -62,2 +62,11 @@ '--accept-server-license-terms', | ||
]; | ||
if (options.profAppendTimers) { | ||
codeArgs.push('--prof-append-timers'); | ||
codeArgs.push(options.profAppendTimers); | ||
} | ||
const markers = options.durationMarkers?.length ? [...options.durationMarkers] : ['ellapsed']; | ||
for (const marker of markers) { | ||
codeArgs.push('--prof-duration-markers'); | ||
codeArgs.push(marker); | ||
} | ||
if (options.folderToOpen) { | ||
@@ -69,10 +78,2 @@ codeArgs.push(options.folderToOpen); | ||
} | ||
const markers = ['ellapsed']; | ||
if (options.durationMarkers) { | ||
markers.push(...options.durationMarkers); | ||
} | ||
for (const marker of markers) { | ||
codeArgs.push('--prof-duration-markers'); | ||
codeArgs.push(marker); | ||
} | ||
const runs = options.runs ?? constants_1.PERFORMANCE_RUNS; | ||
@@ -79,0 +80,0 @@ const durations = new Map(); |
{ | ||
"name": "@vscode/vscode-perf", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Tooling for evaluating performance of VS Code", | ||
@@ -5,0 +5,0 @@ "repository": { |
16899
188