Added examples, Added performance tests, Updated readme

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-11-03 16:51:37 +01:00
parent 3d259d363a
commit 9facb66ee8
44 changed files with 3295 additions and 32 deletions
+17
View File
@@ -0,0 +1,17 @@
# Shared by the Python performance tests, see `_PerfTesting.pbi` for the output format.
import statistics
import time
RUNS = 5
def run(scenario, operations, function):
"""Runs `function` once to warm up, then `RUNS` times, and prints its median."""
check = function()
times = []
for _ in range(RUNS):
start = time.perf_counter()
check = function()
times.append((time.perf_counter() - start) * 1000)
median = statistics.median(times)
print(f"python,{scenario},{median:.1f},{median * 1_000_000 / operations:.1f},{check}", flush=True)