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

Tab switching to Julia Evans' blog is slow #2519

Closed
mstange opened this issue Mar 14, 2018 · 6 comments
Closed

Tab switching to Julia Evans' blog is slow #2519

mstange opened this issue Mar 14, 2018 · 6 comments

Comments

@mstange
Copy link
Contributor

@mstange mstange commented Mar 14, 2018

Bugzilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1444767

Here's a profile of a tab switch to https://jvns.ca/blog/2018/01/26/mac-memory-maps/ : https://perfht.ml/2twMA6Q

There's a composite that takes 132ms.

  • 33ms glBufferData
  • 35ms glTexSubImage3D
  • 37ms glGenerateMipmap
  • 12ms memmove inside glDrawElements
@jrmuizel
Copy link
Contributor

@jrmuizel jrmuizel commented Mar 14, 2018

So for the glGenerateMipmap, I'm wondering if we actually need to do this. High quality downscaling should actually be being handled on the Gecko side. @glennw was this not happening for some reason?

@glennw
Copy link
Member

@glennw glennw commented Mar 14, 2018

The mip map generation code was added for this bug (#2023) and the bugzilla bug referenced in that. We can definitely consider removing it or adding a flag on each image to give Gecko explicit control over whether to generate mips, if that would help?

@mstange
Copy link
Contributor Author

@mstange mstange commented Mar 15, 2018

Here's another profile of slow glGenerateMipmap: https://perfht.ml/2Gv42LJ
Particularly interesting is the part where _gleMakeMipmapDataNPOT is doing the downscaling on the CPU.

I encountered this one during the animation that plays after clicking the "Begin expedition" button on https://developer.microsoft.com/en-us/microsoft-edge/testdrive/demos/variable-fonts/ .

@glennw
Copy link
Member

@glennw glennw commented Mar 15, 2018

I'm guessing from the name of that function your GPU / driver falls back to CPU mipmap generation if the size is non power of two?

@mstange
Copy link
Contributor Author

@mstange mstange commented Mar 21, 2018

Yes, that's what it looks like.

The image that's causing the slowness is the fallback item for a border image: the diagonal stripes on the side which cover the whole length of the page. Is this blob image rasterized in its entirety, or in tiles? Do we mipmap the entire thing or do we mipmap the tiles individually?

@mstange
Copy link
Contributor Author

@mstange mstange commented Mar 26, 2018

This is fixed now that mipmaps are disabled by default.

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

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.