MCPcopy Create free account
hub / github.com/duckdb/duckdb / benchmark

Method benchmark

scripts/regression_test_python.py:229–247  ·  view source on GitHub ↗
(self, benchmark_name)

Source from the content-addressed store, hash-verified

227 self.table = pa.table([array], names=["x"])
228
229 def benchmark(self, benchmark_name) -> BenchmarkResult:
230 self.con.register('arrow_table', self.table)
231 result = BenchmarkResult(benchmark_name)
232 for _ in range(nruns):
233 duration = 0.0
234 start = time.time()
235 res = self.con.execute(
236 """
237 select * from arrow_table
238 """
239 ).fetchall()
240 end = time.time()
241 duration = float(end - start)
242 assert self.expected == res
243 del res
244 padding = " " * len(str(nruns))
245 print_msg(f"T{padding}: {duration}s")
246 result.add(duration)
247 return result
248
249
250class SelectAndCallBenchmark:

Callers 1

Calls 4

addMethod · 0.95
print_msgFunction · 0.85
BenchmarkResultClass · 0.70
timeMethod · 0.45

Tested by

no test coverage detected