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

Method benchmark

scripts/regression_test_python.py:265–285  ·  view source on GitHub ↗
(self, name, query)

Source from the content-addressed store, hash-verified

263 self.con.execute(f"SET threads={threads}")
264
265 def benchmark(self, name, query) -> List[BenchmarkResult]:
266 results: List[BenchmarkResult] = []
267 methods = {'select': 'select * from ', 'call': 'call '}
268 for key, value in methods.items():
269 for rowcount in [2048, 50000, 2500000]:
270 result = BenchmarkResult(f'{key}_{name}_{rowcount}')
271 query_string = query.format(rows=rowcount)
272 query_string = value + query_string
273 rel = self.con.sql(query_string)
274 print_msg(rel.type)
275 for _ in range(nruns):
276 duration = 0.0
277 start = time.time()
278 rel.fetchall()
279 end = time.time()
280 duration = float(end - start)
281 padding = " " * len(str(nruns))
282 print_msg(f"T{padding}: {duration}s")
283 result.add(duration)
284 results.append(result)
285 return results
286
287
288class PandasDFLoadBenchmark:

Callers 1

Calls 5

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

Tested by

no test coverage detected