tbeu / matio

MATLAB MAT File I/O Library
https://matio.sourceforge.io
BSD 2-Clause "Simplified" License
330 stars 97 forks source link

Mat_VarReadNextInfoIterate takes a long time to read mat-file #196

Closed GolubevaP closed 6 months ago

GolubevaP commented 1 year ago

Reading the header by indexes takes a lot of time (several minutes), moreover, it requires a lot of memory to read it. Although this is only needed to make sure that the file can be opened. I realized that the problem is in this method (Mat_VarReadNextInfoIterate), in particular, in nested loops. And also this problem met earlier (https://github.com/tbeu/matio/issues/157). Will you fix it?

Ri0n commented 1 year ago

Hello dear developers.

This PR https://github.com/tbeu/matio/pull/197 partially resolves the problem. But the root of the problem is hidden in usage of H5Iget_name which is extremely slow. I have another patch to resolve it too. Not yet ready for publishing though.

Ri0n commented 1 year ago

And there is a PR for avoiding usage of H5Iget_name https://github.com/Ri0n/matio/pull/1/files

Ri0n commented 1 year ago

A PR for H5Iget_name against this repo https://github.com/tbeu/matio/pull/198 I'm very worried if I could break anything with this change. So I hope developers can propose appropriate tests and teest it on their own.

tbeu commented 1 year ago

@Ri0n Thanks for both your PRs. They are very appreciated.

tbeu commented 1 year ago

@GolubevaP Which MAT-file version did you use? Do you have any MAT-file to share? Thanks.

tbeu commented 8 months ago

@GolubevaP Which MAT-file version did you use? Do you have any MAT-file to share? Thanks.

@GolubevaP Since #157 is fixed and @Ri0n contributed his fixes, can you please test again. Thanks!

tbeu commented 6 months ago

Closing after @GolubevaP not responding.