Skip to content

Prevent unnecessary texture upload on image source updates #12212

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

Merged
merged 4 commits into from
Sep 7, 2022

Conversation

karimnaaji
Copy link
Contributor

@karimnaaji karimnaaji commented Sep 1, 2022

Fixes a regression introduced by #11564.

The reason texture.update was added was mentioned as the following in the original PR:

also uses texture.update rather than always creating a new texture when the source's image is updated

But this introduced another regression since the check did not account whether the image changed at all making it run most frames, where it was running previously only when the texture had to be created.

Launch Checklist

  • briefly describe the changes in this PR
  • manually test the debug page
  • apply changelog label ('bug', 'feature', 'docs', etc) or use the label 'skip changelog'
  • add an entry inside this element for inclusion in the mapbox-gl-js changelog: <changelog>Fix potential performance regression on image source updates</changelog>

Sorry, something went wrong.

@karimnaaji karimnaaji requested a review from mourner September 1, 2022 22:35
@karimnaaji karimnaaji changed the title Prevent unnecessary texture upload Prevent unnecessary texture upload on image source updates Sep 1, 2022
Copy link
Member

@mourner mourner left a comment

Choose a reason for hiding this comment

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

👍 The only reservation I have is that it doesn't have a unit test, so it might regress in a future refactoring. Although I'm not sure whether this can be tested cleanly. Feel free to merge if not.

@mourner mourner linked an issue Sep 2, 2022 that may be closed by this pull request
@yuvadm
Copy link

yuvadm commented Sep 5, 2022

Is there any easy way to pull the PR build from CI to help test it? Alternatively, is there an estimate on when this fix lands in a release?

@mourner
Copy link
Member

mourner commented Sep 6, 2022

@yuvadm Here's a build I made from this branch — hopefully enough to test this out: mapbox-gl-texture-fix.zip

@karimnaaji
Copy link
Contributor Author

@yuvadm let us know once you give it a try in your context.

@yuvadm
Copy link

yuvadm commented Sep 7, 2022

@karimnaaji Yep, this fix definitely seems to do the trick! When can we expect it to be merged and released?

@karimnaaji
Copy link
Contributor Author

Thanks for trying it out @yuvadm. This change will be carried out to the next release (v2.11.0) that we're aiming at deploying sometime this month.

@karimnaaji karimnaaji merged commit d3f78d6 into main Sep 7, 2022
@karimnaaji karimnaaji deleted the karim/fix-12209 branch September 7, 2022 17:28
@yuvadm
Copy link

yuvadm commented Oct 11, 2022

@karimnaaji @mourner is there any estimate on the v2.11 release date?

@karimnaaji
Copy link
Contributor Author

hey @yuvadm , sorry for the delay. We're aiming at deploying a beta this week or early next week. We still have another pending fix we're going after before we can deploy the new release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance regression in ImageSource between v1 and v2
3 participants