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

Loading might be a little too lazy, leading to long access times #4

Closed
tlnagy opened this issue Mar 23, 2020 · 0 comments · Fixed by #10
Closed

Loading might be a little too lazy, leading to long access times #4

tlnagy opened this issue Mar 23, 2020 · 0 comments · Fixed by #10

Comments

@tlnagy
Copy link
Owner

tlnagy commented Mar 23, 2020

My current strategy has been to store the data in-memory exactly as on disk and lazily transform it on access to the expected dimensions and shape. While this leads to great loading times, access is quite slow (~100-150x slower than ImageMagick.jl). Alternatively, I could try to create both the target image location and a buffer that is sized to the maximum number of bytes expected. I could read into this buffer, apply transforms lazily, and then save into the target (realizing the transforms).

tlnagy added a commit that referenced this issue Mar 24, 2020
This has a pretty massive effect on performance. Accessing a single
pixel went from ~20ns to 8ns with this change. Only 5x slower than no
lazy transformation at all. Working on #4
tlnagy added a commit that referenced this issue Jan 1, 2021
this implementation uses the idea from #4 where load the raw data,
lazily apply transformations and then eagerly realize the final
version to reduce the access-time penalty. It might be possible
to refactor this code a bit further to dispatch on the IFD layout
so that I can avoid a lot of these if/else statements and off load
them to compile time.
@tlnagy tlnagy mentioned this issue Jan 1, 2021
@tlnagy tlnagy closed this as completed in #10 Jan 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant