(self, name, query)
| 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 | |
| 288 | class PandasDFLoadBenchmark: |
no test coverage detected