Skip to content

Avoid tiny numpy arrays in numba: optimize geometry.py - #1790

Draft
Sevans711 wants to merge 4 commits into
mainfrom
sevans/tinynumpynumba-optimize-geometry.py
Draft

Sevans711 wants to merge 4 commits into
mainfrom
sevans/tinynumpynumba-optimize-geometry.py

Conversation

@Sevans711

Copy link
Copy Markdown
Collaborator

Closes #XXX

Overview

Optimizes numba routines in uxarray/grid/area.py to avoid constructing many tiny numpy arrays inside numba routines, as discussed in #1648.

This one was much more complicated to make progress on, compared to the other sub-issues already solved under 1648. The main reasons are: (1) its methods assign numpy arrays whose sizes depend on input variables' shapes, instead of being constant, so it's not trivial to convert to tuples; (2) there is less documentation and more "dead" code here that isn't doing anything, so it took some extra time to figure out what is going on; (3) there are more connections with methods defined in other parts of the code, such as arcs.py, bounds.py, bilinear.py, utils.py, either calling methods from here or being called by methods from here, and (4) call sites are often very deep (>5 clicks before getting to a top-level user-facing function) so it's trickier to track and understand the intended and actual use-cases for these functions sometimes.

Originally attempted more optimizations than this but had to backtrack when it make pytest suite fail in nontrivial ways that were difficult to debug.

Still very much a draft PR, mostly curious to see if these changes are enough to make any dent in ASV benchmarks, or if it might be better to focus more on some of those other files (arcs.py, bounds.py, etc) first. I suspect there might not be huge improvements just yet, because there are still quite a few tiny numpy arrays, and elsewhere I only really saw large speedups after finishing the cleanup to avoid all relevant numpy allocations.

PR Checklist

General

  • An issue is created and linked
  • Added appropriate labels (if your uxarray repo permissions allow it)
  • Filled out Overview and Expected Usage (if applicable) sections

Testing & Benchmarking

  • There is adequate test coverage of changes from this PR (add new tests if needed)
  • If this PR could affect performance, ran ASV benchmarks and confirmed they show expected behavior (add a new benchmark if necessary)

Documentation and Examples

  • Docstrings updated with any function changes, and included in all new functions
  • User (public) functions added to docs/api.rst; internal (private) function names start with an underscore (_)
  • If touched any notebook files, cleared the output of all cells before committing
  • If added new notebook files, put into appropriate directories and referenced in appropriate files

AI Disclosure

AI Usage: Claude for discussion and some code suggestions, plus GitHub Copilot's inline code suggestions

  • I have tested and take responsibility for all AI-generated content in my PR.

and _check_intersection. Improves docstring, refactors slightly (but behavior should be the same) and removes the unused lonlat computations.

Doesn't avoid allocating the `intersection_points` buffer because it's nontrivial to avoid that. (I separately tried it but my changes led to pytest suite failing and I'm not really sure why...) That buffer is only used for faces crossing the equator anyways, so it probably isn't worthwhile to worry too much about optimizing it...
now it avoids allocating tiny numpy arrays.

(Nontrivial to optimize the call site (`barycentric_coordinates_cartesian`) though because the call site might return length 3 or length 4 numpy arrays, depending on inputs. Might be simple to optimize if forcing inputs to barycentric_coordinates_cartesian to be tuples, though, maybe?)
@Sevans711 Sevans711 added scalability Related to scalability & performance efforts run-benchmark Run ASV benchmark workflow labels Sep 25, 2026
@github-actions

github-actions Bot commented Sep 25, 2026 •

Copy link
Copy Markdown

ASV Benchmarking

Benchmark Comparison Results

Benchmarks that have improved:

Change Before [379c895] <v2026.09.1> After [83bdb83] Ratio Benchmark (Parameter)
- 357M 283M 0.79 import.Imports.track_peakmem_import_uxarray
- 357M 321M 0.9 mpas_ocean.GradientColdStartRss.track_peakmem_gradient('480km')

Benchmarks that have stayed the same:

Change Before [379c895] <v2026.09.1> After [83bdb83] Ratio Benchmark (Parameter)
5.32±0.04ms 5.24±0.05ms 0.99 bench_connectivity.Connectivity.time_edge_face('120km')
1.99±0.01ms 2.00±0.02ms 1.00 bench_connectivity.Connectivity.time_edge_face('480km')
4.36±0.04ms 4.32±0.03ms 0.99 bench_connectivity.Connectivity.time_edge_node('120km')
1.58±0.02ms 1.58±0.02ms 1.00 bench_connectivity.Connectivity.time_edge_node('480km')
4.38±0.03ms 4.31±0.03ms 0.98 bench_connectivity.Connectivity.time_face_edge('120km')
1.58±0.01ms 1.59±0.01ms 1.01 bench_connectivity.Connectivity.time_face_edge('480km')
6.19±0.06ms 6.06±0.03ms 0.98 bench_connectivity.Connectivity.time_face_face('120km')
2.35±0.01ms 2.37±0.03ms 1.00 bench_connectivity.Connectivity.time_face_face('480km')
53.5±0.7μs 53.7±0.9μs 1.00 bench_connectivity.Connectivity.time_face_node('120km')
52.4±0.5μs 53.9±0.2μs 1.03 bench_connectivity.Connectivity.time_face_node('480km')
428±10μs 438±70μs 1.02 bench_connectivity.Connectivity.time_n_nodes_per_face('120km')
363±10μs 360±10μs 0.99 bench_connectivity.Connectivity.time_n_nodes_per_face('480km')
6.04±0.5ms 5.64±0.06ms 0.93 bench_connectivity.Connectivity.time_node_edge('120km')
2.00±0ms 1.98±0.01ms 0.99 bench_connectivity.Connectivity.time_node_edge('480km')
75.9±0.4ms 74.7±0.4ms 0.98 bench_connectivity.Connectivity.time_node_face('120km')
5.14±0.07ms 5.11±0.1ms 0.99 bench_connectivity.Connectivity.time_node_face('480km')
8.41±0.09ms 7.93±0.1ms 0.94 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
2.70±0.07ms 2.56±0.04ms 0.95 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
6.91±7s 9.09±10ms ~0.00 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
1.54±0.03ms 1.53±0.03ms 1.00 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
57.3k 57.3k 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
12.3k 12.3k 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
123k 123k 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
128 128 1.00 face_bounds.FaceBounds.track_nbytes_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.27M 1.27M 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
50.1k 50.1k 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
1.48M 1.48M 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
712 712 1.00 face_bounds.FaceBounds.track_nbytes_grid_with_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.98M 1.86M 0.94 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
1.97M 1.86M 0.94 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
2.13M 2.02M 0.95 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
35.5k 35.5k 1.00 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
357M 325M 0.91 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
357M 325M 0.91 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
357M 326M 0.91 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
357M 326M 0.91 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.17±0.02μs 1.17±0.03μs 1.00 geometry_kernels.AccucrossKernels.time_accucross
2.59±0.02μs 2.56±0.03μs 0.99 geometry_kernels.AccucrossKernels.time_accucross_pair
466±20ns 460±10ns 0.99 geometry_kernels.EFTPrimitives.time_acc_sqrt_re
431±9ns 436±10ns 1.01 geometry_kernels.EFTPrimitives.time_diff_of_products
380±10ns 390±20ns 1.03 geometry_kernels.EFTPrimitives.time_two_prod
371±10ns 376±20ns 1.01 geometry_kernels.EFTPrimitives.time_two_sum
691±30ns 646±30ns 0.93 geometry_kernels.GCAConstLatIntersection.time_accux_constlat_kernel
732±10ns 721±20ns 0.99 geometry_kernels.GCAConstLatIntersection.time_gca_const_lat_intersection
841±40ns 766±5ns 0.91 geometry_kernels.GCAConstLatIntersection.time_try_gca_const_lat_intersection
802±40ns 782±10ns 0.97 geometry_kernels.GCAGCAIntersection.time_accux_gca_kernel
907±40ns 871±10ns 0.96 geometry_kernels.GCAGCAIntersection.time_gca_gca_intersection
1.06±0.02μs 1.00±0.01μs 0.94 geometry_kernels.GCAGCAIntersection.time_try_gca_gca_intersection
52.3±0.7μs 51.1±0.7μs 0.98 geometry_kernels.OrientPredicates.time_on_minor_arc
52.6±0.8μs 50.8±0.06μs 0.97 geometry_kernels.OrientPredicates.time_orient3d_on_sphere
3.08±0.02ms 3.06±0.01ms 0.99 geometry_samebody.SameBodyConstLat.time_accux_dispatch
1.16±0.01ms 1.16±0ms 1.00 geometry_samebody.SameBodyConstLat.time_accux_kernel
2.28±0ms 2.29±0.01ms 1.01 geometry_samebody.SameBodyConstLat.time_fp64_dispatch
147±0.6μs 146±0.1μs 0.99 geometry_samebody.SameBodyConstLat.time_fp64_kernel
29.6±0.03ms 29.6±0.02ms 1.00 geometry_samebody_gcagca.SameBodyGcaGca.time_accux_dispatch
6.26±0ms 6.26±0ms 1.00 geometry_samebody_gcagca.SameBodyGcaGca.time_accux_kernel
23.6±0.02ms 23.6±0.04ms 1.00 geometry_samebody_gcagca.SameBodyGcaGca.time_fp64_dispatch
859±0.3μs 863±7μs 1.01 geometry_samebody_gcagca.SameBodyGcaGca.time_fp64_kernel
900±10ms 905±5ms 1.01 import.Imports.timeraw_import_uxarray
2.46±0.02ms 2.46±0.01ms 1.00 mpas_ocean.CheckNorm.time_check_norm('120km')
2.02±0.01ms 2.08±0.04ms 1.03 mpas_ocean.CheckNorm.time_check_norm('480km')
1.14±0.01ms 1.15±0.01ms 1.01 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('120km')
555±9μs 551±10μs 0.99 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('480km')
660±6μs 644±10μs 0.98 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('120km')
615±20μs 602±6μs 0.98 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('480km')
5.33±0.07ms 5.29±0.02ms 0.99 mpas_ocean.ConstructFaceLatLon.time_cartesian_averaging('120km')
3.88±0.02ms 3.84±0.07ms 0.99 mpas_ocean.ConstructFaceLatLon.time_cartesian_averaging('480km')
97.2±0.6ms 96.4±0.1ms 0.99 mpas_ocean.ConstructFaceLatLon.time_welzl('120km')
10.3±2ms 9.57±0.3ms 0.93 mpas_ocean.ConstructFaceLatLon.time_welzl('480km')
18.6±0.03ms 18.7±0.1ms 1.01 mpas_ocean.ConstructTreeStructures.time_ball_tree('120km')
976±20μs 977±4μs 1.00 mpas_ocean.ConstructTreeStructures.time_ball_tree('480km')
10.0±0.04ms 10.0±0.06ms 1.00 mpas_ocean.ConstructTreeStructures.time_kd_tree('120km')
604±6μs 616±10μs 1.02 mpas_ocean.ConstructTreeStructures.time_kd_tree('480km')
593±9ms 586±2ms 0.99 mpas_ocean.CrossSections.time_const_lat('120km', 1)
298±6ms 292±3ms 0.98 mpas_ocean.CrossSections.time_const_lat('120km', 2)
151±0.5ms 151±3ms 1.00 mpas_ocean.CrossSections.time_const_lat('120km', 4)
547±4ms 554±5ms 1.01 mpas_ocean.CrossSections.time_const_lat('480km', 1)
272±2ms 273±2ms 1.01 mpas_ocean.CrossSections.time_const_lat('480km', 2)
138±1ms 138±1ms 1.00 mpas_ocean.CrossSections.time_const_lat('480km', 4)
357M 345M 0.97 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('120km', 1)
357M 345M 0.97 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('120km', 2)
357M 345M 0.97 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('120km', 4)
357M 328M 0.92 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('480km', 1)
357M 328M 0.92 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('480km', 2)
357M 328M 0.92 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('480km', 4)
25.8±0.06ms 25.7±0.1ms 1.00 mpas_ocean.DualMesh.time_dual_mesh_construction('120km')
3.03±0.1ms 2.95±0.1ms 0.97 mpas_ocean.DualMesh.time_dual_mesh_construction('480km')
14.0±0.7ms 14.3±0.6ms 1.02 mpas_ocean.FaceAreas.time_face_areas('120km')
4.36±0.4ms 4.23±0.3ms 0.97 mpas_ocean.FaceAreas.time_face_areas('480km')
229k 229k 1.00 mpas_ocean.FaceAreas.track_nbytes_face_areas('120km')
14.3k 14.3k 1.00 mpas_ocean.FaceAreas.track_nbytes_face_areas('480km')
2.12M 2.12M 1.00 mpas_ocean.FaceAreas.track_peakmem_face_areas('120km')
714k 715k 1.00 mpas_ocean.FaceAreas.track_peakmem_face_areas('480km')
898±3ms 904±2ms 1.01 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', False)
51.2±0.3ms 51.8±2ms 1.01 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', True)
80.3±0.3ms 81.5±2ms 1.01 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', False)
4.98±0.3ms 5.03±0.2ms 1.01 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', True)
13.0±0.03ms 13.1±0.04ms 1.00 mpas_ocean.Gradient.time_gradient('120km')
1.80±0.01ms 1.80±0.01ms 1.00 mpas_ocean.Gradient.time_gradient('480km')
457k 457k 1.00 mpas_ocean.Gradient.track_nbytes_gradient('120km')
28.7k 28.7k 1.00 mpas_ocean.Gradient.track_nbytes_gradient('480km')
3.2M 3.2M 1.00 mpas_ocean.Gradient.track_peakmem_gradient('120km')
204k 204k 1.00 mpas_ocean.Gradient.track_peakmem_gradient('480km')
357M 345M 0.97 mpas_ocean.GradientColdStartRss.track_peakmem_gradient('120km')
274±4μs 281±10μs 1.03 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('120km')
147±2μs 145±0.4μs 0.98 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('480km')
200±4μs 203±9μs 1.02 mpas_ocean.Integrate.time_integrate('120km')
182±3μs 188±9μs 1.03 mpas_ocean.Integrate.time_integrate('480km')
18.4M 18.4M 1.00 mpas_ocean.Integrate.track_nbytes_integrate('120km')
1.2M 1.2M 1.00 mpas_ocean.Integrate.track_nbytes_integrate('480km')
179±1ms 178±2ms 1.00 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'exclude')
178±1ms 180±0.7ms 1.01 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'include')
178±1ms 179±3ms 1.00 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'split')
12.9±0.05ms 12.8±0.06ms 1.00 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'exclude')
13.2±0.2ms 12.8±0.06ms 0.97 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'include')
12.8±0.02ms 13.1±0.08ms 1.02 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'split')
244±0.4ms 245±0.7ms 1.00 mpas_ocean.NeighborhoodBuild.time_build('120km', 1.0)
1.31±0.01s 1.31±0.01s 1.00 mpas_ocean.NeighborhoodBuild.time_build('120km', 15.0)
505±3ms 506±3ms 1.00 mpas_ocean.NeighborhoodBuild.time_build('120km', 5.0)
13.4±0.1ms 13.4±0.1ms 1.00 mpas_ocean.NeighborhoodBuild.time_build('480km', 1.0)
25.0±0.05ms 25.0±0.05ms 1.00 mpas_ocean.NeighborhoodBuild.time_build('480km', 15.0)
16.5±0.1ms 16.5±0.1ms 1.00 mpas_ocean.NeighborhoodBuild.time_build('480km', 5.0)
240±0.4ms 240±0.7ms 1.00 mpas_ocean.NeighborhoodBuild.time_query_radius('120km', 1.0)
1.29±0s 1.28±0s 0.99 mpas_ocean.NeighborhoodBuild.time_query_radius('120km', 15.0)
500±3ms 499±3ms 1.00 mpas_ocean.NeighborhoodBuild.time_query_radius('120km', 5.0)
12.9±0.02ms 13.1±0.02ms 1.02 mpas_ocean.NeighborhoodBuild.time_query_radius('480km', 1.0)
24.7±0.1ms 24.6±0.02ms 1.00 mpas_ocean.NeighborhoodBuild.time_query_radius('480km', 15.0)
16.1±0.1ms 16.0±0.03ms 1.00 mpas_ocean.NeighborhoodBuild.time_query_radius('480km', 5.0)
1.19 1.19 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('120km', 1.0)
612.76 612.76 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('120km', 15.0)
74.17 74.17 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('120km', 5.0)
1.0 1.0 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('480km', 1.0)
37.29 37.29 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('480km', 15.0)
6.57 6.57 1.00 mpas_ocean.NeighborhoodBuild.track_mean_neighbors('480km', 5.0)
728k 728k 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('120km', 1.0)
141M 141M 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('120km', 15.0)
17.4M 17.4M 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('120km', 5.0)
43k 43k 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('480km', 1.0)
563k 563k 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('480km', 15.0)
123k 123k 1.00 mpas_ocean.NeighborhoodBuild.track_nbytes_neighbors('480km', 5.0)
5.72M 5.72M 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('120km', 1.0)
145M 145M 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('120km', 15.0)
21.5M 21.5M 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('120km', 5.0)
362k 362k 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('480km', 1.0)
825k 825k 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('480km', 15.0)
384k 384k 1.00 mpas_ocean.NeighborhoodBuild.track_peakmem_build('480km', 5.0)
43.9±0.5ms 43.5±0.7ms 0.99 mpas_ocean.NeighborhoodDask.time_mean('120km', 'grid_chunks')
22.5±0.1ms 22.5±0.06ms 1.00 mpas_ocean.NeighborhoodDask.time_mean('120km', 'numpy')
39.8±0.4ms 39.1±0.2ms 0.98 mpas_ocean.NeighborhoodDask.time_mean('120km', 'time_chunks')
11.5±0.2ms 11.3±0.09ms 0.98 mpas_ocean.NeighborhoodDask.time_mean('480km', 'grid_chunks')
688±10μs 676±20μs 0.98 mpas_ocean.NeighborhoodDask.time_mean('480km', 'numpy')
8.18±0.1ms 8.16±0.1ms 1.00 mpas_ocean.NeighborhoodDask.time_mean('480km', 'time_chunks')
5.84M 5.84M 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('120km', 'grid_chunks')
2.75M 2.75M 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('120km', 'numpy')
5.69M 5.68M 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('120km', 'time_chunks')
685k 675k 0.99 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'grid_chunks')
177k 177k 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'numpy')
546k 542k 0.99 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'time_chunks')
12.6±0.02s 12.6±0s 1.00 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('120km', 'mean')
13.3±0.01s 13.3±0s 1.00 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('120km', 'median')
224±0.7ms 226±2ms 1.01 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('480km', 'mean')
229±0.1ms 229±1ms 1.00 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('480km', 'median')
1.35±0s 1.35±0s 1.00 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('120km', 'mean')
1.54±0s 1.54±0s 1.00 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('120km', 'median')
25.6±0.03ms 25.6±0.01ms 1.00 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('480km', 'mean')
26.8±0.04ms 27.2±0.02ms 1.01 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('480km', 'median')
38.0±0.2ms 38.1±0.2ms 1.00 mpas_ocean.NeighborhoodReduce.time_reduce('120km', 'mean')
233±1ms 233±1ms 1.00 mpas_ocean.NeighborhoodReduce.time_reduce('120km', 'median')
416±8μs 432±10μs 1.04 mpas_ocean.NeighborhoodReduce.time_reduce('480km', 'mean')
1.65±0.01ms 1.64±0.01ms 1.00 mpas_ocean.NeighborhoodReduce.time_reduce('480km', 'median')
239k 239k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('120km', 'mean')
245k 245k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('120km', 'median')
19.4k 19.4k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('480km', 'mean')
19.9k 19.9k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('480km', 'median')
411±10μs 397±20μs 0.97 mpas_ocean.PointInPolygon.time_face_search_lonlat('120km')
408±10μs 413±10μs 1.01 mpas_ocean.PointInPolygon.time_face_search_lonlat('480km')
390±10μs 389±10μs 1.00 mpas_ocean.PointInPolygon.time_face_search_xyz('120km')
394±10μs 373±10μs 0.95 mpas_ocean.PointInPolygon.time_face_search_xyz('480km')
17.0±0.1ms 16.9±0.1ms 1.00 mpas_ocean.RemapDownsample.time_inverse_distance_weighted_remapping
15.5±0.07ms 15.3±0.05ms 0.99 mpas_ocean.RemapDownsample.time_nearest_neighbor_remapping
25.5±0.2ms 26.2±0.6ms 1.03 mpas_ocean.RemapUpsample.time_inverse_distance_weighted_remapping
12.4±0.2ms 12.6±0.2ms 1.02 mpas_ocean.RemapUpsample.time_nearest_neighbor_remapping
7.87±0.1ms 7.89±0.09ms 1.00 mpas_ocean.ZonalAverage.time_zonal_average('120km')
5.08±0.07ms 5.11±0.05ms 1.01 mpas_ocean.ZonalAverage.time_zonal_average('480km')
357M 346M 0.97 mpas_ocean.ZonalAveragePeakMem.track_peakmem_zonal_average('120km')
357M 330M 0.92 mpas_ocean.ZonalAveragePeakMem.track_peakmem_zonal_average('480km')
1.030301598300003 1.0308992991003 1.00 nogil_scaling.GILScaling.track_gil_scaling
7.42±0.1ms 7.16±0.1ms 0.97 quad_hexagon.QuadHexagon.time_open_dataset
6.04±0.03ms 6.06±1ms 1.00 quad_hexagon.QuadHexagon.time_open_grid
408 408 1.00 quad_hexagon.QuadHexagon.track_nbytes_open_dataset
392 392 1.00 quad_hexagon.QuadHexagon.track_nbytes_open_grid
73.2k 73.6k 1.01 quad_hexagon.QuadHexagon.track_peakmem_open_dataset
72.4k 72.7k 1.01 quad_hexagon.QuadHexagon.track_peakmem_open_grid

Benchmarks that have got worse:

Change Before [379c895] <v2026.09.1> After [83bdb83] Ratio Benchmark (Parameter)
! 130±0.2ms failed n/a mpas_ocean.RemapDownsample.time_bilinear_remapping
! 1.42±0.01s failed n/a mpas_ocean.RemapUpsample.time_bilinear_remapping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-benchmark Run ASV benchmark workflow scalability Related to scalability & performance efforts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant