Skip to content

Commit

Permalink
Change memory allocation benchmarks from on-demand to standard; reduc…
Browse files Browse the repository at this point in the history
…e minimum memory threshold.
  • Loading branch information
pp-mo committed May 17, 2024
1 parent 14bb05d commit 0d37bba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 2 additions & 2 deletions benchmarks/benchmarks/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class TrackAddedMemoryAllocation:
"""

RESULT_MINIMUM_MB = 1.0
RESULT_ROUND_DP = 1
RESULT_MINIMUM_MB = 0.2
RESULT_ROUND_DP = 1 # I.E. to nearest 0.1 Mb

def __enter__(self):
tracemalloc.start()
Expand Down
5 changes: 1 addition & 4 deletions benchmarks/benchmarks/experimental/ugrid/regions_combine.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
from iris.experimental.ugrid import PARSE_UGRID_ON_LOAD
from iris.experimental.ugrid.utils import recombine_submeshes

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


Expand Down Expand Up @@ -183,7 +183,6 @@ 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 @@ -204,7 +203,6 @@ def time_save(self, n_cubesphere):
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 @@ -234,7 +232,6 @@ def time_stream_file2file(self, n_cubesphere):
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")
2 changes: 0 additions & 2 deletions benchmarks/benchmarks/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ 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

0 comments on commit 0d37bba

Please sign in to comment.