Skip to content

Commit

Permalink
add n_transcripts_per_cell to benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
berombau committed Nov 13, 2024
1 parent dd8848b commit 81b3bfb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions benchmarks/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ PYTHONWARNINGS="ignore" asv run --python=same --show-stderr -b time_query_boundi
output:

```
[100.00%] ··· ======== ============ ============
-- filter_table
-------- -------------------------
length True False
======== ============ ============
100 191±2ms 185±2ms
1000 399±4ms 382±7ms
10000 2.67±0.02s 2.18±0.01s
======== ============ ============
[50.00%] ··· ======== ============ ============== ============= ===============
-- filter_table / n_transcripts_per_cell
-------- ---------------------------------------------------------
length True / 100 True / 10000 False / 100 False / 10000
======== ============ ============== ============= ===============
100 813±0ms 1.09±0s 803±0ms 980±0ms
1000 799±0ms 2.96±0s 789±0ms 2.81±0s
10000 1.32±0s 24.4±0s 962±0ms 21.5±0s
======== ============ ============== ============= ===============
```

run everything in new env
Expand Down
14 changes: 7 additions & 7 deletions benchmarks/spatialdata_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ def time_map_blocks(self, _):

class TimeQueries:

params = ([100, 1000, 10_000], [True, False])
param_names = ["length", "filter_table"]
params = ([100, 1000, 10_000], [True, False], [100, 10_000])
param_names = ["length", "filter_table", "n_transcripts_per_cell"]

def setup(self, length, filter_table):
def setup(self, length, filter_table, n_transcripts_per_cell):
import shapely

self.sdata = cluster_blobs(length=length)
self.sdata = cluster_blobs(length=length, n_transcripts_per_cell=n_transcripts_per_cell)
self.polygon = shapely.box(0, 0, length // 2, length // 2)

def teardown(self, length, filter_table):
def teardown(self, length, filter_table, n_transcripts_per_cell):
del self.sdata

def time_query_bounding_box(self, length, filter_table):
def time_query_bounding_box(self, length, filter_table, n_transcripts_per_cell):
self.sdata.query.bounding_box(
axes=["x", "y"],
min_coordinate=[0, 0],
Expand All @@ -66,7 +66,7 @@ def time_query_bounding_box(self, length, filter_table):
filter_table=filter_table,
)

def time_query_polygon_box(self, length, filter_table):
def time_query_polygon_box(self, length, filter_table, n_transcripts_per_cell):
sd.polygon_query(
self.sdata,
self.polygon,
Expand Down

0 comments on commit 81b3bfb

Please sign in to comment.