HTMLMediaElement::updateActiveTextTrackCues is called several times a second to see if text track cues need to be rendered. Unfortunately, it does a fair amount of work even when there are no text tracks at all.
Created attachment 160640 [details] Proposed fix.
Comment on attachment 160640 [details] Proposed fix. View in context: https://bugs.webkit.org/attachment.cgi?id=160640&action=review It's a good check, but I don't think it's enough to close this bug - it's about unnecessary work when there actually are tracks associated with the video. > Source/WebCore/html/HTMLMediaElement.cpp:715 > + if (RuntimeEnabledFeatures::webkitVideoTrackEnabled() && m_textTracks) I think checking for m_textTracks should be in updateActiveTextTrackCues. Even better, HTMLMediaElement::ignoreTrackDisplayUpdateRequests() could become { return !m_textTracks || m_ignoreTrackDisplayUpdate > 0; }
(In reply to comment #2) > (From update of attachment 160640 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=160640&action=review > > It's a good check, but I don't think it's enough to close this bug - it's about unnecessary work when there actually are tracks associated with the video. > > > Source/WebCore/html/HTMLMediaElement.cpp:715 > > + if (RuntimeEnabledFeatures::webkitVideoTrackEnabled() && m_textTracks) > > I think checking for m_textTracks should be in updateActiveTextTrackCues. Even better, HTMLMediaElement::ignoreTrackDisplayUpdateRequests() could become { return !m_textTracks || m_ignoreTrackDisplayUpdate > 0; } I agree with Victor. Additionally, the "LOG(...)" in HTMLMediaElement::updateActiveTextTrackCues should be after the ignoreTrackDisplayUpdateRequests check.
<rdar://problem/13783424>
Created attachment 200229 [details] Proposed patch
Comment on attachment 200229 [details] Proposed patch Clearing flags on attachment: 200229 Committed r149443: <http://trac.webkit.org/changeset/149443>
All reviewed patches have been landed. Closing bug.