Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster binio reading #440

Merged
merged 2 commits into from
Jun 7, 2022
Merged

Faster binio reading #440

merged 2 commits into from
Jun 7, 2022

Conversation

olemke
Copy link
Member

@olemke olemke commented Jun 3, 2022

Add new function binistream::readDoubleArray to improve read
performance of binary xml files significantly (up to 20x depending
on disk speed, OS and compiler) by reading directly into the memory
of the matpack variable, bypassing the slow istream::read.

Here are two benchmarks on Linux (GCC x86_64) and on macOS (Clang arm64).
Case 1 is reading a 76MB Vector, case 2 a 760MB GriddedField3:

Case 1 Case 2
Linux (master) 0.2287s 2.479s
Linux (this PR) 0.0123s 0.165s
macOS (master) 0.1318s 1.451s
macOS (this PR) 0.0071s 0.081s

Both systems show a performance increase of around 15-18x.
Note that the files are cached in memory to benchmark
the actual code performance, not the performance of the disk.
However, all times for the "before" tests are still significantly slower
than the available bandwidth of the underlying SSD could offer.

Remove non-IEEE support.

Modernize code.

Add new function binistream::readDoubleArray to improve read
performance signficantly by bypassing the slow istream::read.
@olemke olemke merged commit 4ffdaf6 into atmtools:master Jun 7, 2022
@olemke olemke deleted the faster-binio branch June 7, 2022 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant