(self, benchmark_name)
| 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 | |
| 250 | class SelectAndCallBenchmark: |
no test coverage detected