Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Oct 23, 2024
1 parent 7e996bc commit 51606c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 28 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
27 changes: 2 additions & 25 deletions bindings/python/benchmarks/benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 51606c3

Please sign in to comment.