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

Fix poor performance with texture cache and HDR files #2662

Merged

Conversation

brechtvl
Copy link
Contributor

@brechtvl brechtvl commented Aug 6, 2020

Description

When the texture cache reads scanlines in random order, the same pixels could
be read many times over. Now the file offset for scanlines is cached for quick
random access.

Example command that is 18x faster here with this change:

oiiotool 8k.hdr --autotile 16 --flip -o out.exr

Tests

I'm not aware of an existing mechanism to test such performance issues.

Checklist:

  • I have read the contribution guidelines.
  • If this is more extensive than a small change to existing code, I
    have previously submitted a Contributor License Agreement
    (individual, and if there is any way my
    employers might think my programming belongs to them, then also
    corporate).
  • I have updated the documentation, if applicable.
  • I have ensured that the change is tested somewhere in the testsuite
    (adding new test cases if necessary).
  • My code follows the prevailing code style of this project.

When the texture cache reads scanlines in random order, the same pixels could
be read many times over. Now the file offset for scanlines is cached for quick
random access.
@lgritz
Copy link
Collaborator

lgritz commented Aug 6, 2020

That's awesome!

@lgritz lgritz merged commit 6ce93a1 into AcademySoftwareFoundation:master Aug 6, 2020
@lgritz
Copy link
Collaborator

lgritz commented Aug 6, 2020

How far back would you like this backported, @brechtvl ? Obvs 2.2. Do you want a 2.1 backport also, considering that 2.2 will be the supported release at the end of the month?

lgritz pushed a commit to lgritz/OpenImageIO that referenced this pull request Aug 6, 2020
…eFoundation#2662)

When the texture cache reads scanlines in random order, the same pixels could
be read many times over. Now the file offset for scanlines is cached for quick
random access.
@brechtvl
Copy link
Contributor Author

brechtvl commented Aug 8, 2020

We don't need a backport to 2.1 then.

@brechtvl brechtvl deleted the fix-hdr-random-access branch May 27, 2023 22:32
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.

None yet

2 participants