Skip to content

Cache the asv environment and fixtures, and report durations - #2

Closed
cmdupuis3 wants to merge 63 commits into
mainfrom
cmd/bench_shards
Closed

cmdupuis3 wants to merge 63 commits into
mainfrom
cmd/bench_shards

Conversation

@cmdupuis3

@cmdupuis3 cmdupuis3 commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

Companion to UXARRAY#1700

Overview

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 Opus 5

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

cmdupuis3 and others added 27 commits August 21, 2026 12:07
asv preimports the benchmark suite before it runs any setup_cache
(asv/runner.py, spawner.preimport() ahead of the run loop), so on a cold
cache bench_connectivity's import-time preload_topologies is what fills
it -- serially, in the forkserver parent, before a single benchmark
starts. CachedFixtures.setup_cache then finds everything already built,
and prime(workers=...) never runs on the path it was written for.

Filling it from the CLI first puts those reads back in the parallel
prime. Worth a second or two on the GitHub runners, which only see the
oQU grids; worth rather more on a machine that can reach the four
dyamond grids on campaign storage.

Co-Authored-By: Claude Opus 5 <[email protected]>
@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

ASV Benchmarking

Benchmark Comparison Results

Benchmarks that have improved:

Change Before [140b91c] After [3fdfd1f] Ratio Benchmark (Parameter)
- 758k 671k 0.89 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'grid_chunks')

Benchmarks that have stayed the same:

Change Before [140b91c] After [3fdfd1f] Ratio Benchmark (Parameter)
1.00±0.02ms 973±10μs 0.97 connectivity.Connectivity.time_edge_face('120km')
480±20μs 474±10μs 0.99 connectivity.Connectivity.time_edge_face('480km')
3.93±0.04ms 3.99±0.07ms 1.02 connectivity.Connectivity.time_edge_node('120km')
1.30±0.02ms 1.26±0.03ms 0.97 connectivity.Connectivity.time_edge_node('480km')
81.6±9μs 70.7±10μs ~0.87 connectivity.Connectivity.time_face_edge('120km')
69.5±7μs 70.6±8μs 1.02 connectivity.Connectivity.time_face_edge('480km')
1.00±0.01ms 1.00±0.05ms 1.00 connectivity.Connectivity.time_face_face('120km')
424±30μs 429±10μs 1.01 connectivity.Connectivity.time_face_face('480km')
62.8±10μs 64.8±3μs 1.03 connectivity.Connectivity.time_face_node('120km')
63.9±20μs 65.9±10μs 1.03 connectivity.Connectivity.time_face_node('480km')
471±10μs 489±20μs 1.04 connectivity.Connectivity.time_n_nodes_per_face('120km')
414±30μs 411±30μs 0.99 connectivity.Connectivity.time_n_nodes_per_face('480km')
1.36±0.04ms 1.37±0.03ms 1.01 connectivity.Connectivity.time_node_edge('120km')
497±20μs 475±10μs 0.96 connectivity.Connectivity.time_node_edge('480km')
75.0±2ms 78.4±0.7ms 1.04 connectivity.Connectivity.time_node_face('120km')
5.07±0.06ms 5.13±0.07ms 1.01 connectivity.Connectivity.time_node_face('480km')
1.42M 1.42M 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_edge_face('120km')
106k 106k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_edge_face('480km')
6.48M 6.48M 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_edge_node('120km')
417k 417k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_edge_node('480km')
2.42k 2.42k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_edge('120km')
2.42k 2.42k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_edge('480km')
1.6M 1.6M 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_face('120km')
101k 101k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_face('480km')
2.54k 2.54k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_node('120km')
2.54k 2.54k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_face_node('480km')
240k 240k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_n_nodes_per_face('120km')
25.8k 25.8k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_n_nodes_per_face('480km')
1.9M 1.9M 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_node_edge('120km')
127k 127k 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_node_edge('480km')
11.9M 11.9M 1.00 connectivity.ConnectivityTracemalloc.track_peakmem_node_face('120km')
747k 742k 0.99 connectivity.ConnectivityTracemalloc.track_peakmem_node_face('480km')
5.93±0.08ms 5.89±0.07ms 0.99 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
1.91±0.02ms 1.89±0.07ms 0.99 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
7.39±0.04ms 7.31±9ms 0.99 face_bounds.FaceBounds.time_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
1.04±0.02ms 1.04±0.02ms 0.99 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'))
2.03M 2.03M 1.00 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
2.03M 2.03M 1.00 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
2.19M 2.19M 1.00 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
35.5k 35.4k 1.00 face_bounds.FaceBounds.track_peakmem_face_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
1.11±0.01μs 1.18±2μs 1.06 geometry_kernels.AccucrossKernels.time_accucross
2.62±0.02μs 2.61±0.06μs 1.00 geometry_kernels.AccucrossKernels.time_accucross_pair
301±10ns 316±20ns 1.05 geometry_kernels.EFTPrimitives.time_acc_sqrt_re
301±8ns 320±10ns 1.06 geometry_kernels.EFTPrimitives.time_diff_of_products
290±4ns 280±9ns 0.97 geometry_kernels.EFTPrimitives.time_two_prod
271±20ns 261±5ns 0.96 geometry_kernels.EFTPrimitives.time_two_sum
656±10ns 671±30ns 1.02 geometry_kernels.GCAConstLatIntersection.time_accux_constlat_kernel
721±30ns 731±30ns 1.01 geometry_kernels.GCAConstLatIntersection.time_gca_const_lat_intersection
742±10ns 821±20ns ~1.11 geometry_kernels.GCAConstLatIntersection.time_try_gca_const_lat_intersection
571±10ns 571±20ns 1.00 geometry_kernels.GCAGCAIntersection.time_accux_gca_kernel
651±20ns 676±20ns 1.04 geometry_kernels.GCAGCAIntersection.time_gca_gca_intersection
746±8ns 781±30ns 1.05 geometry_kernels.GCAGCAIntersection.time_try_gca_gca_intersection
27.8±0.1μs 29.8±5μs 1.07 geometry_kernels.OrientPredicates.time_on_minor_arc
28.1±0.2μs 29.8±0.4μs 1.06 geometry_kernels.OrientPredicates.time_orient3d_on_sphere
3.98±0.01ms 3.95±0.02ms 0.99 geometry_samebody.SameBodyConstLat.time_accux_dispatch
1.16±0.02ms 1.14±0.03ms 0.99 geometry_samebody.SameBodyConstLat.time_accux_kernel
3.51±0.02ms 3.47±0.01ms 0.99 geometry_samebody.SameBodyConstLat.time_fp64_dispatch
139±0.03μs 141±3μs 1.02 geometry_samebody.SameBodyConstLat.time_fp64_kernel
22.7±0.06ms 22.8±0.01ms 1.00 geometry_samebody_gcagca.SameBodyGcaGca.time_accux_dispatch
5.53±0.01ms 5.54±0.01ms 1.00 geometry_samebody_gcagca.SameBodyGcaGca.time_accux_kernel
17.7±0.06ms 17.8±0.02ms 1.01 geometry_samebody_gcagca.SameBodyGcaGca.time_fp64_dispatch
698±0.6μs 698±0.8μs 1.00 geometry_samebody_gcagca.SameBodyGcaGca.time_fp64_kernel
887±8ms 895±10ms 1.01 import.Imports.timeraw_import_uxarray
2.45±0.01ms 2.53±0.07ms 1.03 mpas_ocean.CheckNorm.time_check_norm('120km')
2.04±0.03ms 2.04±0.05ms 1.00 mpas_ocean.CheckNorm.time_check_norm('480km')
799±10μs 809±7μs 1.01 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('120km')
394±10μs 382±5μs 0.97 mpas_ocean.ConnectivityConstruction.time_face_face_connectivity('480km')
519±7μs 504±6μs 0.97 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('120km')
432±10μs 419±6μs 0.97 mpas_ocean.ConnectivityConstruction.time_n_nodes_per_face('480km')
3.39±0.02ms 3.38±0.01ms 1.00 mpas_ocean.ConstructFaceLatLon.time_cartesian_averaging('120km')
2.57±0ms 2.57±0.01ms 1.00 mpas_ocean.ConstructFaceLatLon.time_cartesian_averaging('480km')
78.5±0.2ms 79.0±0.2ms 1.01 mpas_ocean.ConstructFaceLatLon.time_welzl('120km')
7.18±0.02ms 7.52±0.3ms 1.05 mpas_ocean.ConstructFaceLatLon.time_welzl('480km')
18.6±0.03ms 18.8±0.1ms 1.01 mpas_ocean.ConstructTreeStructures.time_ball_tree('120km')
967±10μs 955±20μs 0.99 mpas_ocean.ConstructTreeStructures.time_ball_tree('480km')
10.1±0.04ms 10.0±0.08ms 0.99 mpas_ocean.ConstructTreeStructures.time_kd_tree('120km')
624±10μs 615±10μs 0.99 mpas_ocean.ConstructTreeStructures.time_kd_tree('480km')
405±1ms 406±2ms 1.00 mpas_ocean.CrossSections.time_const_lat('120km', 1)
211±2ms 205±1ms 0.97 mpas_ocean.CrossSections.time_const_lat('120km', 2)
107±0.7ms 107±0.4ms 1.00 mpas_ocean.CrossSections.time_const_lat('120km', 4)
366±4ms 361±4ms 0.99 mpas_ocean.CrossSections.time_const_lat('480km', 1)
183±2ms 179±0.4ms 0.98 mpas_ocean.CrossSections.time_const_lat('480km', 2)
92.6±0.2ms 93.9±1ms 1.01 mpas_ocean.CrossSections.time_const_lat('480km', 4)
338M 355M 1.05 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('120km', 1)
338M 355M 1.05 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('120km', 2)
338M 355M 1.05 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('120km', 4)
26.0±0.2ms 26.0±0.2ms 1.00 mpas_ocean.DualMesh.time_dual_mesh_construction('120km')
2.89±0.01ms 3.06±0.05ms 1.06 mpas_ocean.DualMesh.time_dual_mesh_construction('480km')
14.1±0.6ms 14.2±0.3ms 1.01 mpas_ocean.FaceAreas.time_face_areas('120km')
4.29±0.06ms 4.31±0.2ms 1.01 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')
715k 715k 1.00 mpas_ocean.FaceAreas.track_peakmem_face_areas('480km')
637±3ms 635±3ms 1.00 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', False)
38.3±0.7ms 38.7±0.7ms 1.01 mpas_ocean.GeoDataFrame.time_to_geodataframe('120km', True)
55.6±0.1ms 55.8±0.6ms 1.00 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', False)
3.66±0.08ms 3.90±0.1ms 1.07 mpas_ocean.GeoDataFrame.time_to_geodataframe('480km', True)
10.2±0.03ms 10.3±0.04ms 1.01 mpas_ocean.Gradient.time_gradient('120km')
1.29±0.01ms 1.32±0.01ms 1.02 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')
334M 355M 1.06 mpas_ocean.GradientColdStartRss.track_peakmem_gradient('120km')
330±7μs 332±4μs 1.01 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('120km')
148±4μs 147±9μs 1.00 mpas_ocean.HoleEdgeIndices.time_construct_hole_edge_indices('480km')
205±9μs 203±10μs 0.99 mpas_ocean.Integrate.time_integrate('120km')
194±5μs 193±10μs 1.00 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')
181±2ms 186±2ms 1.03 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'exclude')
182±2ms 186±4ms 1.02 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'include')
181±2ms 182±4ms 1.01 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('120km', 'split')
13.1±0.2ms 13.0±0.2ms 1.00 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'exclude')
12.8±0.08ms 13.4±0.3ms 1.04 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'include')
13.0±0.1ms 13.2±0.2ms 1.01 mpas_ocean.MatplotlibConversion.time_dataarray_to_polycollection('480km', 'split')
246±2ms 244±0.06ms 1.00 mpas_ocean.NeighborhoodBuild.time_build('120km', 1.0)
508±2ms 504±3ms 0.99 mpas_ocean.NeighborhoodBuild.time_build('120km', 5.0)
13.3±0.1ms 13.4±0.1ms 1.01 mpas_ocean.NeighborhoodBuild.time_build('480km', 1.0)
16.4±0.08ms 16.6±0.01ms 1.01 mpas_ocean.NeighborhoodBuild.time_build('480km', 5.0)
240±0.1ms 241±1ms 1.00 mpas_ocean.NeighborhoodBuild.time_query_radius('120km', 1.0)
498±0.8ms 503±2ms 1.01 mpas_ocean.NeighborhoodBuild.time_query_radius('120km', 5.0)
13.0±0.09ms 13.0±0.1ms 0.99 mpas_ocean.NeighborhoodBuild.time_query_radius('480km', 1.0)
16.2±0.1ms 16.2±0.08ms 1.00 mpas_ocean.NeighborhoodBuild.time_query_radius('480km', 5.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)
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)
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)
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)
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)
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)
42.9±0.5ms 43.1±0.5ms 1.00 mpas_ocean.NeighborhoodDask.time_mean('120km', 'grid_chunks')
21.6±0.2ms 21.5±0.1ms 1.00 mpas_ocean.NeighborhoodDask.time_mean('120km', 'numpy')
38.9±0.5ms 40.0±0.7ms 1.03 mpas_ocean.NeighborhoodDask.time_mean('120km', 'time_chunks')
9.60±0.1ms 9.59±0.2ms 1.00 mpas_ocean.NeighborhoodDask.time_mean('480km', 'grid_chunks')
752±2μs 768±7μs 1.02 mpas_ocean.NeighborhoodDask.time_mean('480km', 'numpy')
6.36±0.05ms 6.55±0.08ms 1.03 mpas_ocean.NeighborhoodDask.time_mean('480km', 'time_chunks')
5.82M 5.82M 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.68M 5.68M 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('120km', 'time_chunks')
177k 177k 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'numpy')
538k 539k 1.00 mpas_ocean.NeighborhoodDask.track_peakmem_mean('480km', 'time_chunks')
5.49±0.02s 5.51±0.03s 1.01 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('120km', 'mean')
5.70±0.01s 5.60±0.01s 0.98 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('120km', 'median')
145±0.6ms 143±0.9ms 0.98 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('480km', 'mean')
146±1ms 146±2ms 1.00 mpas_ocean.NeighborhoodReduce.time_dataset_reduce('480km', 'median')
606±2ms 608±3ms 1.00 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('120km', 'mean')
647±2ms 642±2ms 0.99 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('120km', 'median')
19.9±0.2ms 20.1±0.3ms 1.01 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('480km', 'mean')
20.5±0.3ms 19.9±0.5ms 0.97 mpas_ocean.NeighborhoodReduce.time_neighborhood_reduce('480km', 'median')
5.37±0.1ms 5.25±0.02ms 0.98 mpas_ocean.NeighborhoodReduce.time_reduce('120km', 'mean')
45.9±0.6ms 45.3±0.5ms 0.99 mpas_ocean.NeighborhoodReduce.time_reduce('120km', 'median')
216±3μs 225±8μs 1.04 mpas_ocean.NeighborhoodReduce.time_reduce('480km', 'mean')
546±10μs 529±30μs 0.97 mpas_ocean.NeighborhoodReduce.time_reduce('480km', 'median')
234k 234k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('120km', 'mean')
235k 235k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('120km', 'median')
19.5k 19.5k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('480km', 'mean')
19.5k 19.5k 1.00 mpas_ocean.NeighborhoodReduce.track_peakmem_reduce('480km', 'median')
424±5μs 455±10μs 1.07 mpas_ocean.PointInPolygon.time_face_search_lonlat('120km')
415±5μs 446±20μs 1.07 mpas_ocean.PointInPolygon.time_face_search_lonlat('480km')
402±8μs 405±10μs 1.01 mpas_ocean.PointInPolygon.time_face_search_xyz('120km')
389±6μs 399±7μs 1.03 mpas_ocean.PointInPolygon.time_face_search_xyz('480km')
128±1ms 129±1ms 1.01 mpas_ocean.RemapDownsample.time_bilinear_remapping
16.9±0.09ms 17.1±0.2ms 1.01 mpas_ocean.RemapDownsample.time_inverse_distance_weighted_remapping
15.4±0.02ms 15.5±0.07ms 1.01 mpas_ocean.RemapDownsample.time_nearest_neighbor_remapping
929±6ms 943±8ms 1.02 mpas_ocean.RemapUpsample.time_bilinear_remapping
19.9±0.05ms 19.9±0.09ms 1.00 mpas_ocean.RemapUpsample.time_inverse_distance_weighted_remapping
8.13±0.01ms 8.07±0.01ms 0.99 mpas_ocean.RemapUpsample.time_nearest_neighbor_remapping
6.37±0.1ms 6.63±0.1ms 1.04 mpas_ocean.ZonalAverage.time_zonal_average('120km')
3.57±0.01ms 3.63±0.06ms 1.02 mpas_ocean.ZonalAverage.time_zonal_average('480km')
339M 355M 1.05 mpas_ocean.ZonalAveragePeakMem.track_peakmem_zonal_average('120km')
324M 355M 1.09 mpas_ocean.ZonalAveragePeakMem.track_peakmem_zonal_average('480km')
1.0201620940433669 1.0278796774970587 1.01 nogil_scaling.GILScaling.track_gil_scaling
7.08±0.06ms 7.04±0.08ms 0.99 quad_hexagon.QuadHexagon.time_open_dataset
5.98±0.05ms 6.03±0.09ms 1.01 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.8k 1.01 quad_hexagon.QuadHexagon.track_peakmem_open_dataset
72.4k 72.9k 1.01 quad_hexagon.QuadHexagon.track_peakmem_open_grid

Benchmarks that have got worse:

Change Before [140b91c] After [3fdfd1f] Ratio Benchmark (Parameter)
+ 318M 355M 1.11 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/mpas/QU/oQU480.231010.nc'))
+ 319M 355M 1.11 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/scrip/outCSne8/outCSne8.nc'))
+ 320M 355M 1.11 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/geoflow-small/grid.nc'))
+ 319M 355M 1.11 face_bounds.FaceBoundsColdStartRss.track_peakmem_open_and_bounds(PosixPath('/home/runner/work/uxarray/uxarray/test/meshfiles/ugrid/quad-hexagon/grid.nc'))
+ 276M 356M 1.29 import.Imports.track_peakmem_import_uxarray
+ 322M 355M 1.1 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('480km', 1)
+ 322M 355M 1.1 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('480km', 2)
+ 321M 355M 1.1 mpas_ocean.CrossSectionsPeakMem.track_peakmem_const_lat('480km', 4)
+ 313M 355M 1.13 mpas_ocean.GradientColdStartRss.track_peakmem_gradient('480km')

cmdupuis3 and others added 17 commits August 28, 2026 12:55
Main now carries squash-merged versions of work this branch had unsquashed
(cached benchmark I/O UXARRAY#1700, lazy/cached neighborhood kernels UXARRAY#1708/UXARRAY#1768,
asv env installs UXARRAY#1776, connectivity peakmem benchmarks UXARRAY#1661). Conflicts
resolved in main's favor except where the branch adds sharding:

- asv-benchmarking-pr.yml: keep the sharded setup/shard/merge jobs; adopt
  UXARRAY#1776's asv env cache key (ci/environment.yml + asv.conf.json, no
  restore-keys) in both jobs; drop a duplicated CPU topology step.
- asv-benchmarking.yml: take main's unguarded fixture priming; apply the same
  env cache key fix.
- asv.conf.json: take main's matrix and comments; keep the branch's BLAS
  thread pins in env_nobuild.
- .gitignore: keep the per-shard config/results entries.
- bench_connectivity.py: accept deletion; superseded by connectivity.py.
- neighbors.py, _fixtures.py, _warmup.py, mpas_ocean.py, geometry_samebody*:
  take main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cmd/bench_io is stale: its content landed on main as UXARRAY#1700 and has since been
superseded there (UXARRAY#1768 neighborhood kernels, UXARRAY#1776 asv env). This branch
already carries main, so every conflict resolves to the branch's side and the
tree is unchanged; the merge only records bench_io's history so PR #2 against
it is mergeable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
asv continuous is the same interleaved run plus a comparison, and exits 1
when the comparison finds a regression -- the status it also uses for a
broken run -- so any slower benchmark failed its shard (shards 0 and 1 in
run 37510066776). Shards now only measure; the merge job compares.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cmdupuis3
cmdupuis3 changed the base branch from cmd/bench_io to main October 6, 2026 20:59
cmdupuis3 and others added 11 commits October 6, 2026 16:44
The main merge left a duplicate warm_in_parent import and a docstring-only
diff against main; both files now match main.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Text only: module docstrings cut to purpose, key constraints and usage;
comments to one or two lines of why. Fixes two that had drifted from the
code (a stale stderr claim in _threads.resolve, a contradictory matrix note
in asv.conf.hpc.json) and a comment above the wheels cache that described
the durations cache.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
NeighborhoodReduce ran at r=15, where a 120km face has ~600 neighbors and
time_dataset_reduce alone took over a minute per round -- the class that
bounded the slowest shard. It now runs at 5, shared with NeighborhoodDask
as NEIGHBORHOOD_RADIUS.

NeighborhoodBuild swept r over 1, 5 and 15 for every benchmark. The
timings now skip 15 (1.3s per call at 120km) and the track_* benchmarks
skip 1, where peakmem and nbytes barely move (362k vs 384k at 480km).
asv reads params from the method first, so this stays one class and the
kernels still compile once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Same shards, caches and pre-builds; about 630 fewer lines.

- _merge: union rows and max durations. Every shard's benchmarks.json
  already lists the whole suite (asv saves all it discovers), and the
  conflict, ordering and column-realignment paths were unreachable.
- _partition: group by class. No setup_cache outside _fixtures spans
  classes, so the union-find never merged more. --shard now implies
  --asv-args; the uncalled --bench-args and --config-out are gone, and
  the report lists the heaviest benchmarks in place of the workflow's
  inline script.
- _machine: write asv's detected specs under the pinned name directly,
  replacing `asv machine --yes` plus a rename.
- Drop the unused _threads.py and asv.conf.hpc.json. The latter had
  drifted from asv.conf.json (no conda_environment_file), so HPC runs
  built a different env than CI. stage.pbs now always sets
  NUMBA_NUM_THREADS (default 8; numba's default counts SMT siblings) and
  passes -a timeout=1800.
- local.sh pins each shard to whole physical cores in socket order, so
  concurrent shards no longer share SMT siblings on nodes that number
  them N and N + cores.
- PR workflow: YAML anchors for the steps repeated across jobs, one
  SHARDS setting, and a shorter baseline resolution.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ns from main

asv_runner re-runs setup before every sample, about six times per benchmark
process. NeighborhoodReduce.time_reduce timed a 5ms kernel at 120km but took
27s, and NeighborhoodDask.time_mean 49s for 1-40ms calls, almost all setup.
That made NeighborhoodReduce alone larger than a quarter of the suite, which
capped a 4-shard split at 3.2x.

- NeighborhoodReduce and NeighborhoodDask build their fixture, warmup and
  neighborhood once per process. The timed calls only read them. The grid
  caches a single ball tree and time_dataset_reduce leaves it on edges, so
  setup restores the face tree each sample, as a fresh setup did.
- main's benchmark workflow saves the commit it just ran under the
  asv-results cache key. PR caches are scoped to their PR, so every PR's
  first run had no durations and split by count (this branch's first run:
  shards of 3:11, 4:48, 2:17 and 9:49).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- _merge: seed each file from the first shard that has it and fold later
  shards' results in, telling result files by their "results" key rather
  than a list of whole-file names. rel is now relpath, since keys keep the
  machine directory.
- The results artifact is named with runner.os again, as on main. The
  comment workflow still downloads asv-benchmark-results-Linux.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
load_weights keeps every sample, so the median costs nothing over the mean
and ignores a single cold-numba outlier once there are three or more, as in
a local results dir with history. CI restores two samples per benchmark
(base and PR), where the two agree.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Skip machine.json by its missing "results", as _merge does, and index
result_columns without a fallback: every v2 results file (asv >= 0.5) has
a duration column, and asv itself won't read a v1 file without asv update.
The median doesn't depend on order, so the glob needn't be sorted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
benchmark_classes maps each class (or module, for a bare function) to its
(benchmark name, cost) pairs, and class_costs to their total, in place of
classes, class_cost and owner. Plans are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@cmdupuis3 cmdupuis3 closed this Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant