Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/sweep-benchmarks-state.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module,last_inspected,issue,severity_max,categories_found,notes
edge_detection,2026-07-18,3672,MEDIUM,1,"No bench file existed; all 5 public funcs (sobel_x/y, prewitt_x/y, laplacian) uncovered. Compute delegates to convolve_2d (directly benchmarked, but only at 5x5/25x25 kernels, never 3x3, never via the wrappers) so MEDIUM not HIGH. Added benchmarks/benchmarks/edge_detection.py: EdgeDetection class, nx in [300,3000], numpy/cupy/dask, one timing method per public func. All 30 combos executed locally incl. cupy (GPU host). Cat 2/3/4 N/A (module implements no backends itself; no pre-existing bench to be broken)."
geotiff,2026-07-02,3603,HIGH,1;2,"No benchmark existed for geotiff; open_geotiff/to_geotiff had zero asv coverage across numpy/dask/cupy. Added benchmarks/benchmarks/geotiff.py: WriteGeoTIFF (numpy/dask/cupy streaming), WriteCOG (numpy/cupy overview pyramid), ReadGeoTIFF (numpy/cupy decode), ReadGeoTIFFChunked (dask). All classes executed locally via direct call; cupy paths run on this GPU host. asv check discover fails suite-wide from an asv_runner + py3.14 metadata bug, unrelated to this file."
pathfinding,2026-07-08,3645,HIGH,1;2;3,"Bench covered only numpy a_star_search at nx<=300; module also ships dask (separate sparse-Python A* + LRU chunk cache), cupy fallback, and public multi_stop_search with zero coverage. Extended AStarSearch to numpy/cupy/dask with nx up to 1000 (dask capped at 300, ~4s/call at 1000) and added MultiStopSearch (ordered + optimize_order). All combos executed locally incl. cupy (GPU host). LOW noted, not fixed: open-grid no-barrier/no-friction input is A* best case. dask+cupy not parameterized anywhere in suite (common.get_xr_dataarray has no such type). Existing bench imports/runs fine (Cat 4 clean)."
34 changes: 34 additions & 0 deletions benchmarks/benchmarks/edge_detection.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from xrspatial.edge_detection import laplacian, prewitt_x, prewitt_y, sobel_x, sobel_y

from .common import get_xr_dataarray


class EdgeDetection:
params = ([300, 3000], ["numpy", "cupy", "dask"])
param_names = ("nx", "type")

def setup(self, nx, type):
ny = nx // 2
self.agg = get_xr_dataarray((ny, nx), type)

def _run(self, func):
result = func(self.agg)
# dask returns a lazy array; force the compute so the benchmark
# times the kernel, not just graph construction.
if hasattr(result.data, 'compute'):
result.data.compute()

def time_sobel_x(self, nx, type):
self._run(sobel_x)

def time_sobel_y(self, nx, type):
self._run(sobel_y)

def time_prewitt_x(self, nx, type):
self._run(prewitt_x)

def time_prewitt_y(self, nx, type):
self._run(prewitt_y)

def time_laplacian(self, nx, type):
self._run(laplacian)
Loading