Skip to content

Dolfyn: dolfyn_read is slow relative to MHKiT-Python #178

@simmsa

Description

@simmsa

Reading an original binary ADCP file is slow in MHKiT-MATLAB.

In examples/adcp_example.m:

ds = dolfyn_read('data/dolfyn/Sig1000_tidal.ad2cp');

Yields:

  Reading binary data...
Reading file data/dolfyn/Sig1000_tidal.ad2cp
    Binary read time: 62.498 seconds
  Post-processing...
    sci_data time: 0.033 seconds
    reorg time: 0.099 seconds
    reduce time: 0.008 seconds

The bulk of the read time is in reading the raw ADCP data

For comparison this code in MHKiT-Python:

import time

from mhkit import dolfyn

start_time = time.perf_counter()

ds = dolfyn.read("data/dolfyn/Sig1000_tidal.ad2cp")

end_time = time.perf_counter()

print(f"dolfyn.read execution time: {end_time - start_time:.4f} seconds")

Yields:

Reading file data/dolfyn/Sig1000_tidal.ad2cp ...
dolfyn.read execution time: 3.2022 seconds

This needs further investigation. In general MHKiT-MATLAB should use a similar read strategy as MHKiT-Python. We should leverage the MHKiT-Python repo and code to investigate this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions