diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 3ffa34b5..1b99d402 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -66,8 +66,8 @@ jobs: - name: Compare benchmarks run: | - asv compare refs/bm/merge-target refs/bm/pr -- + asv compare --factor 1.2 --split refs/bm/merge-target refs/bm/pr -- + - name: Fail if any benchmarks have slowed down too much run: | - asv compare --factor 1.2 --split refs/bm/merge-target refs/bm/pr - ! asv compare --factor 1.2 --split refs/bm/merge-target refs/bm/pr | grep -q "got worse" + ! asv compare --factor 1.2 --split refs/bm/merge-target refs/bm/pr 2> /dev/null | grep -q "got worse" diff --git a/bindings/python/benchmarks/benchmarks.py b/bindings/python/benchmarks/benchmarks.py index 892c78ae..65cd9b7b 100644 --- a/bindings/python/benchmarks/benchmarks.py +++ b/bindings/python/benchmarks/benchmarks.py @@ -114,11 +114,6 @@ class Read(ABC): def setup(self): raise NotImplementedError - # We need this because the naive methods don't always convert nested objects. - @staticmethod # noqa: B027 - def exercise_table(table): - pass - def time_conventional_ndarray(self): collection = db.benchmark cursor = collection.find(projection={"_id": 0}) @@ -147,13 +142,11 @@ def time_to_pandas(self): def time_conventional_arrow(self): c = db.benchmark f = list(c.find({}, projection={"_id": 0})) - table = pa.Table.from_pylist(f) - self.exercise_table(table) + pa.Table.from_pylist(f) def time_to_arrow(self): c = db.benchmark - table = find_arrow_all(c, {}, schema=self.schema, projection={"_id": 0}) - self.exercise_table(table) + find_arrow_all(c, {}, schema=self.schema, projection={"_id": 0}) def time_conventional_polars(self): collection = db.benchmark @@ -211,14 +204,6 @@ def setup(self): % (N_DOCS, len(BSON.encode(base_dict)) // 1024, len(base_dict)) ) - # We need this because the naive methods don't always convert nested objects. - @staticmethod - def exercise_table(table): - [ - [[n for n in i.values] if isinstance(i, pa.ListScalar) else i for i in column] - for column in table.columns - ] - # All of the following tests are being skipped because NumPy/Pandas do not work with nested arrays. def time_to_numpy(self): pass @@ -260,14 +245,6 @@ def setup(self): % (N_DOCS, len(BSON.encode(base_dict)) // 1024, len(base_dict)) ) - # We need this because the naive methods don't always convert nested objects. - @staticmethod - def exercise_table(table): - [ - [[n for n in i.values()] if isinstance(i, pa.StructScalar) else i for i in column] - for column in table.columns - ] - # All of the following tests are being skipped because NumPy/Pandas do not work with nested documents. def time_to_numpy(self): pass