Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Feb 17, 2025
1 parent 42e40ca commit f463f7c
Showing 1 changed file with 18 additions and 19 deletions.
37 changes: 18 additions & 19 deletions icechunk-python/benchmarks/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,24 @@ def initialize(self) -> None:

def run(self, *, pytest_extra: str = "") -> None:
super().run(pytest_extra=pytest_extra)
if len(refs) > 1:
files = sorted(
glob.glob("./.benchmarks/**/*.json", recursive=True),
key=os.path.getmtime,
reverse=True,
)[-len(refs) :]
# TODO: Use `just` here when we figure that out.
subprocess.run(
[
"pytest-benchmark",
"compare",
"--group=group,func,param",
"--sort=fullname",
"--columns=median",
"--name=normal",
*files,
]
)


class CoiledRunner(Runner):
Expand Down Expand Up @@ -262,25 +280,6 @@ def init_for_ref(runner: Runner):
for runner in tqdm.tqdm(runners):
runner.run(pytest_extra=args.pytest)

if len(refs) > 1:
files = sorted(
glob.glob("./.benchmarks/**/*.json", recursive=True),
key=os.path.getmtime,
reverse=True,
)[-len(refs) :]
# TODO: Use `just` here when we figure that out.
subprocess.run(
[
"pytest-benchmark",
"compare",
"--group=group,func,param",
"--sort=fullname",
"--columns=median",
"--name=normal",
*files,
]
)


# Compare wish-list:
# 1. skip differences < X%
Expand Down

0 comments on commit f463f7c

Please sign in to comment.