Skip to content

Commit

Permalink
Set some memory benchmarks to on-demand to reduce noise. (#5481)
Browse files Browse the repository at this point in the history
  • Loading branch information
trexfeathers authored Oct 3, 2023
1 parent 47ec7f3 commit 58220d1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
8 changes: 7 additions & 1 deletion benchmarks/benchmarks/experimental/ugrid/regions_combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from iris.experimental.ugrid import PARSE_UGRID_ON_LOAD
from iris.experimental.ugrid.utils import recombine_submeshes

from ... import TrackAddedMemoryAllocation
from ... import TrackAddedMemoryAllocation, on_demand_benchmark
from ...generate_data.ugrid import make_cube_like_2d_cubesphere


Expand Down Expand Up @@ -200,6 +200,8 @@ class CombineRegionsComputeRealData(MixinCombineRegions):
def time_compute_data(self, n_cubesphere):
_ = self.recombined_cube.data

# Vulnerable to noise, so disabled by default.
@on_demand_benchmark
@TrackAddedMemoryAllocation.decorator
def track_addedmem_compute_data(self, n_cubesphere):
_ = self.recombined_cube.data
Expand All @@ -217,6 +219,8 @@ def time_save(self, n_cubesphere):
# Save to disk, which must compute data + stream it to file.
save(self.recombined_cube, "tmp.nc")

# Vulnerable to noise, so disabled by default.
@on_demand_benchmark
@TrackAddedMemoryAllocation.decorator
def track_addedmem_save(self, n_cubesphere):
save(self.recombined_cube, "tmp.nc")
Expand Down Expand Up @@ -245,6 +249,8 @@ def time_stream_file2file(self, n_cubesphere):
# Save to disk, which must compute data + stream it to file.
save(self.recombined_cube, "tmp.nc")

# Vulnerable to noise, so disabled by default.
@on_demand_benchmark
@TrackAddedMemoryAllocation.decorator
def track_addedmem_stream_file2file(self, n_cubesphere):
save(self.recombined_cube, "tmp.nc")
4 changes: 3 additions & 1 deletion benchmarks/benchmarks/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from iris import save
from iris.experimental.ugrid import save_mesh

from . import TrackAddedMemoryAllocation
from . import TrackAddedMemoryAllocation, on_demand_benchmark
from .generate_data.ugrid import make_cube_like_2d_cubesphere


Expand Down Expand Up @@ -47,6 +47,8 @@ def time_netcdf_save_mesh(self, n_cubesphere, is_unstructured):
if is_unstructured:
self._save_mesh(self.cube)

# Vulnerable to noise, so disabled by default.
@on_demand_benchmark
@TrackAddedMemoryAllocation.decorator
def track_addedmem_netcdf_save(self, n_cubesphere, is_unstructured):
# Don't need to copy the cube here since track_ benchmarks don't
Expand Down
5 changes: 3 additions & 2 deletions docs/src/whatsnew/latest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ This document explains the changes made to Iris for this release
working properly. (Main pull request: :pull:`5437`, more detail:
:pull:`5430`, :pull:`5431`, :pull:`5432`, :pull:`5434`, :pull:`5436`)

#. `@trexfeathers`_ set a number of memory benchmarks to be on-demand, as they
were vulnerable to false positives in CI runs. (:pull:`5481`)

#. `@acchamber`_ and `@ESadek-MO`_ resolved several deprecation to reduce
number of warnings raised during tests.
(:pull:`5493`, :pull:`5511`)
Expand All @@ -96,8 +99,6 @@ This document explains the changes made to Iris for this release
longer using the ``--strict`` argument. (:pull:`5496`)




.. comment
Whatsnew author names (@github name) in alphabetical order. Note that,
core dev names are automatically included by the common_links.inc:
Expand Down

0 comments on commit 58220d1

Please sign in to comment.