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

Reintroduce single cache for successive scanline reads #1899

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

kdt3rd
Copy link
Contributor

@kdt3rd kdt3rd commented Oct 26, 2024

Previously we allowed multiple threads to cache but that caused memory bloat, here, only keep one so successive reads will be faster for compression types where there are more than one scanline per chunk

Fixes #1887

Previously we allowed multiple threads to cache but that caused memory
bloat, here, only keep one so successive reads will be faster for
compression types where there are more than one scanline per chunk

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
@haaninjo
Copy link

Thanks, this greatly helps opening speed in GIMP.

Tested and clocked opening 3 exr images created in Darktable:

File Opening time before Opening time with this patch
A 6s Instant
B 32s <2s
C 65s <2s

Copy link
Member

@cary-ilm cary-ilm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, except does it break the ABI?

abipkgdiff reports that it detects data members that have changed sizes.

@lgritz
Copy link
Contributor

lgritz commented Oct 26, 2024

Looks good to me, except does it break the ABI?

abipkgdiff reports that it detects data members that have changed sizes.

I think this might be a flawed process for detecting ABI changes. This patch doesn't change any public headers. The class whose size is changing is totally internal.

There ought to either be an explicit list of these classes and functions to exclude from ABI checks, or better yet, enclose all of them in a private namespace so they can be excluded in one fell swoop.

@kdt3rd
Copy link
Contributor Author

kdt3rd commented Oct 27, 2024

The public ABI does not change with this, as this is in the pImpl internal class. However, is declared as a private struct within the public class such that there can be a non-void pointer in the public class. We could make it an empty struct type and derive a truly private subclass in a namespace, but would add a bunch of casts or double pointer for little gain?

Detecting ABI changes is a bit fraught, and so I think at best it should just be reviewed manually and not something to be relied upon automated testing for - a simple equal-size typedef change can trigger an apparent abi difference, even though not actually any different.

@kdt3rd
Copy link
Contributor Author

kdt3rd commented Oct 27, 2024

for the next release (3.4 or 4.0), I would like to take another review of public / private symbols as there are a lot of "utility" classes exposed that should not really be part of the public interface (although have been, so will need to go through a deprecation period), perhaps there is a different way we could achieve this such that abi diff tools can better ignore (i.e. making the pImpl class as a hidden class might work?)

@cary-ilm cary-ilm merged commit 366eeb1 into AcademySoftwareFoundation:main Oct 30, 2024
34 checks passed
@kdt3rd kdt3rd deleted the fix_1887 branch October 31, 2024 05:35
cary-ilm pushed a commit that referenced this pull request Nov 3, 2024
Previously we allowed multiple threads to cache but that caused memory
bloat, here, only keep one so successive reads will be faster for
compression types where there are more than one scanline per chunk

Signed-off-by: Kimball Thurston <kdt3rd@gmail.com>
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.

Slow opening of exr image in GIMP
4 participants