Home / Function/ benchmarkCommand() — astro Function Reference

benchmarkCommand() — astro Function Reference

Architecture documentation for the benchmarkCommand() function in cli-startup.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  18a2b2ae_4c68_5978_d2cd_e2a17cf7702e["benchmarkCommand()"]
  4f5ebd66_3fdf_8047_4c83_d856ee583eeb["cli-startup.js"]
  18a2b2ae_4c68_5978_d2cd_e2a17cf7702e -->|defined in| 4f5ebd66_3fdf_8047_4c83_d856ee583eeb
  ef4d7e54_ae69_2f6b_edc8_8cd7f39da8e4["run()"]
  ef4d7e54_ae69_2f6b_edc8_8cd7f39da8e4 -->|calls| 18a2b2ae_4c68_5978_d2cd_e2a17cf7702e
  726183f0_decf_6bca_ceb6_e7759e37fb91["calculateStat()"]
  18a2b2ae_4c68_5978_d2cd_e2a17cf7702e -->|calls| 726183f0_decf_6bca_ceb6_e7759e37fb91
  style 18a2b2ae_4c68_5978_d2cd_e2a17cf7702e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

benchmark/bench/cli-startup.js lines 41–53

async function benchmarkCommand(command, args, root) {
	/** @type {number[]} */
	const durations = [];

	for (let i = 0; i < 10; i++) {
		const start = performance.now();
		await exec(command, args, { nodeOptions: { cwd: root }, throwOnError: true });
		durations.push(performance.now() - start);
	}

	// From the 10 durations, calculate average, standard deviation, and max value
	return calculateStat(durations);
}

Subdomains

Called By

Frequently Asked Questions

What does benchmarkCommand() do?
benchmarkCommand() is a function in the astro codebase, defined in benchmark/bench/cli-startup.js.
Where is benchmarkCommand() defined?
benchmarkCommand() is defined in benchmark/bench/cli-startup.js at line 41.
What does benchmarkCommand() call?
benchmarkCommand() calls 1 function(s): calculateStat.
What calls benchmarkCommand()?
benchmarkCommand() is called by 1 function(s): run.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free