(fn, items: list[str])
| 133 | sample = rng.sample(symbols, min(NUM_QUERY_SAMPLES, len(symbols))) |
| 134 | |
| 135 | def avg_ms(fn, items: list[str]) -> float | None: |
| 136 | times: list[float] = [] |
| 137 | for it in items: |
| 138 | t = time.perf_counter() |
| 139 | fn(it) |
| 140 | times.append(time.perf_counter() - t) |
| 141 | return round(sum(times) / len(times) * 1000, 3) if times else None |
| 142 | |
| 143 | out["find_symbol_avg_ms"] = avg_ms(queries["find_symbol"], sample) |
| 144 | out["get_function_source_avg_ms"] = avg_ms(queries["get_function_source"], sample) |
no outgoing calls
no test coverage detected