Skip to content

Commit

Permalink
adjust join perf test
Browse files Browse the repository at this point in the history
  • Loading branch information
nameexhaustion committed Feb 18, 2025
1 parent 4d4f86f commit 53d1474
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions py-polars/tests/unit/operations/test_join.py
Original file line number Diff line number Diff line change
Expand Up @@ -1793,6 +1793,10 @@ def time_func(func: Callable[[], Any]) -> float:
runtime_lazy = time_func(lambda: left.lazy().join_where(right.lazy(), p).collect())
runtime_ratio = runtime_eager / runtime_lazy

if runtime_ratio > 1.3:
msg = f"runtime_ratio ({runtime_ratio}) > 1.3x ({runtime_eager = }, {runtime_lazy = })"
# Pick as high as reasonably possible for CI stability
# * Was observed to be >=5 seconds on the bugged version, so 3 is a safe bet.
threshold = 3

if runtime_ratio > threshold:
msg = f"runtime_ratio ({runtime_ratio}) > {threshold}x ({runtime_eager = }, {runtime_lazy = })"
raise ValueError(msg)

0 comments on commit 53d1474

Please sign in to comment.