MCPcopy Create free account
hub / github.com/apache/datafusion / run_benchmark

Function run_benchmark

benchmarks/compile_profile.py:125–153  ·  view source on GitHub ↗
(profile: str, data_path: Path)

Source from the content-addressed store, hash-verified

123
124
125def run_benchmark(profile: str, data_path: Path) -> float:
126 binary_dir = PROFILE_TARGET_DIR.get(profile)
127 if not binary_dir:
128 raise ValueError(f"unknown profile '{profile}'")
129 binary_path = REPO_ROOT / "target" / binary_dir / BENCHMARK_BINARY
130 if not binary_path.exists():
131 raise FileNotFoundError(f"compiled binary not found at {binary_path}")
132
133 command = [
134 str(binary_path),
135 "tpch",
136 "--iterations",
137 str(DEFAULT_ITERATIONS),
138 "--path",
139 str(data_path),
140 "--format",
141 DEFAULT_FORMAT,
142 ]
143 if DEFAULT_PARTITIONS is not None:
144 command.extend(["--partitions", str(DEFAULT_PARTITIONS)])
145 env = os.environ.copy()
146 env.setdefault("RUST_LOG", "warn")
147
148 start = time.perf_counter()
149 try:
150 subprocess.run(command, cwd=REPO_ROOT, env=env, check=True)
151 except subprocess.CalledProcessError as exc:
152 raise RuntimeError(f"benchmark failed for profile '{profile}'") from exc
153 return time.perf_counter() - start
154
155
156def binary_size(profile: str) -> int:

Callers 1

mainFunction · 0.70

Calls 5

strFunction · 0.85
existsMethod · 0.80
getMethod · 0.45
extendMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…