Closed Bug 1677927 (sw-wr-perf-blend-yuv) Opened 10 months ago Closed 7 months ago

Very slow video decode for TikTok embeds (sw-wr)

Categories

(Core :: Graphics: WebRender, defect)

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox85 --- disabled

People

(Reporter: yoasif, Assigned: lsalzman)

References

(Blocks 1 open bug, )

Details

(Keywords: nightly-community)

Attachments

(3 files)

Load https://www.vox.com/the-goods/2020/11/17/21570160/tiktok-selfie-pose-addison-charli and play each video one after another.

What happens: video very quickly goes out of sync and basically never recovers. Audio is fine.

Profile: https://share.firefox.dev/2IMaZNA

Attached file about:support

:yoasif, if you think that's a regression, then could you try to find a regression range in using for example mozregression?

Yeah, this should be improved by 1675990

Asif, are you still seeing this in latest Nightly?

Flags: needinfo?(yoasif)

Still bad in the latest nightly - see new profile: https://share.firefox.dev/35FMLgU

Flags: needinfo?(yoasif)

Yeah, https://hg.mozilla.org/mozilla-central/rev/5e315caacc27 hasn't made it out into a nightly yet.

Blocks: gfx-triage
See Also: → 1678877
Severity: -- → S3
No longer blocks: gfx-triage

Has this been fixed by bug 1675990 and bug 1678954?

Flags: needinfo?(yoasif)

It is still not great.

Flags: needinfo?(yoasif)
Assignee: nobody → lsalzman
Status: NEW → ASSIGNED
Keywords: leave-open
Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4d812a500d97
avoid some unnecessary anti-aliasing work in YUV shader SWGL fast-path. r=jrmuizel

This is still pretty bad for me (e5e734f4fc19, 2021-1-21, including 4d812a500d97, but not 8e682a665334 for bug 1676554).

I'm seeing:

  • 20% cs_clip_rectangle
  • 30% (combined) brush_yuv_image_ALPHA_PASS_TEXTURE_RECT_YUV_frag
  • 12% cs_clip_rectangle_FAST_PATH_frag

This fails to hit the fast-path in bug 1674618 because blending is used. linear_row_yuv could probably be adapted to support blending, but at the same time, performance here may be adequate as is so long as I can do some time to reduce the work we spend in cs_clip_rectangle.

Alias: sw-wr-perf-blend-yuv
Blocks: 1677257

Despite having to move around some code into other files, this patch actually
changes very little inside composite.h and swgl_ext.h. It makes linear_row_yuv
able to call blend_pixels, and in turn makes blendYUV call that version of it.
This prevents cases where we have to blend video (because of clip masks) from
falling off the fast path.

To allow this, I had to move out blend stage code into blend.h so that it can
be called from inside composite.h. While I was at it, it made sense to factor
out the rasterization stage into its own rasterize.h file as well, as gl.cc
has grown significantly...

Attachment #9205066 - Attachment description: Bug 1677927 - Accelerated blended YUV in SWGL. r?jrmuizel → Bug 1677927 - Accelerate blended YUV in SWGL. r?jrmuizel

It seems like allowing acceleration of blended YUV leaves mostly the significant overhead of rendering the clip mask itself, which will probably speed up a bunch of other cases for us.

Pushed by lsalzman@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/61b57740f175
Accelerate blended YUV in SWGL. r=jrmuizel
Blocks: 1673008

Comment on attachment 9205066 [details]
Bug 1677927 - Accelerate blended YUV in SWGL. r?jrmuizel

Beta/Release Uplift Approval Request

  • User impact if declined: Trying to do partial SW-WR rollout on Linux. Would like to avoid people reporting significant performance regressions months down the line. This avoids embedded video being slow on some major sites like TikTok/Twitter/Facebook/etc.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Only impacts SW-WR/Linux. We can abort the rollout if unstable. Adequate time to deal with any bugs.
  • String changes made/needed:
Attachment #9205066 - Flags: approval-mozilla-beta?

Comment on attachment 9205066 [details]
Bug 1677927 - Accelerate blended YUV in SWGL. r?jrmuizel

Approved for 87.0b4.

Attachment #9205066 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9205066 [details]
Bug 1677927 - Accelerate blended YUV in SWGL. r?jrmuizel

https://hg.mozilla.org/releases/mozilla-beta/rev/8a7a300d0c6f

Removing the approval to get this off the needs-uplift radar since this bug is marked leave-open.

Attachment #9205066 - Flags: approval-mozilla-beta+

With bug 1682194, the remaining clip rectangle overhead is mostly resolved. Closing this out to make room for new perf bugs.

Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Keywords: leave-open
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.