Skip to content

Commit 13b4ccb

Browse files
committed
Add missing preloaded ros3 file reading benchmark
1 parent 33c1a47 commit 13b4ccb

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

src/nwb_benchmarks/benchmarks/network_tracking_remote_file_reading.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,30 @@ def track_network_read_hdf5_pynwb_remfile_preloaded_with_cache(self, params: dic
336336
return network_tracker.asv_network_statistics
337337

338338

339+
class HDF5PyNWBRos3PreloadedFileReadBenchmark(BaseBenchmark):
340+
"""
341+
Track the network activity during read of remote HDF5 NWB files using the ROS3 HDF5 driver with preloaded cache.
342+
"""
343+
344+
params = hdf5_redirected_read_params
345+
346+
def setup(self, params: dict[str, str]):
347+
https_url = params["https_url"]
348+
self.nwbfile, self.io, _ = read_hdf5_pynwb_ros3(https_url=https_url)
349+
350+
def teardown(self, params: dict[str, str]):
351+
if hasattr(self, "io"):
352+
self.io.close()
353+
354+
@skip_benchmark_if(TSHARK_PATH is None)
355+
def track_network_read_hdf5_pynwb_ros3_preloaded_with_cache(self, params: dict[str, str]):
356+
"""Read remote NWB file using the ROS3 HDF5 driver with preloaded cache."""
357+
https_url = params["https_url"]
358+
with network_activity_tracker(tshark_path=TSHARK_PATH) as network_tracker:
359+
self.nwbfile, self.io, _ = read_hdf5_pynwb_ros3(https_url=https_url)
360+
return network_tracker.asv_network_statistics
361+
362+
339363
class LindiLocalJSONFileReadBenchmark(BaseBenchmark):
340364
"""
341365
Track the network activity during read of remote HDF5 files by reading the local LINDI JSON files with lindi and

src/nwb_benchmarks/benchmarks/time_remote_file_reading.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,27 @@ def time_read_hdf5_pynwb_remfile_preloaded_with_cache(self, params: dict[str, st
263263
)
264264

265265

266+
class HDF5PyNWBRos3PreloadedFileReadBenchmark(BaseBenchmark):
267+
"""
268+
Time the read of remote HDF5 NWB files using the ROS3 HDF5 driver with preloaded cache.
269+
"""
270+
271+
params = hdf5_redirected_read_params
272+
273+
def setup(self, params: dict[str, str]):
274+
https_url = params["https_url"]
275+
self.nwbfile, self.io, _ = read_hdf5_pynwb_ros3(https_url=https_url)
276+
277+
def teardown(self, params: dict[str, str]):
278+
if hasattr(self, "io"):
279+
self.io.close()
280+
281+
def time_read_hdf5_pynwb_ros3_preloaded_with_cache(self, params: dict[str, str]):
282+
"""Read remote NWB file using the ROS3 HDF5 driver with preloaded cache."""
283+
https_url = params["https_url"]
284+
self.nwbfile, self.io, _ = read_hdf5_pynwb_ros3(https_url=https_url)
285+
286+
266287
class LindiLocalJSONFileReadBenchmark(BaseBenchmark):
267288
"""
268289
Time the read of remote HDF5 NWB files by reading the local LINDI JSON files using lindi and h5py or pynwb.

0 commit comments

Comments
 (0)