[wp-trac] [WordPress Trac] #32597: mediaelement.js high CPU usage in Firefox

WordPress Trac noreply at wordpress.org
Wed Sep 16 07:14:45 UTC 2020


#32597: mediaelement.js high CPU usage in Firefox
--------------------------------+------------------------------
 Reporter:  afercia             |       Owner:  (none)
     Type:  defect (bug)        |      Status:  new
 Priority:  normal              |   Milestone:  Awaiting Review
Component:  External Libraries  |     Version:
 Severity:  normal              |  Resolution:
 Keywords:                      |     Focuses:
--------------------------------+------------------------------
Changes (by afercia):

 * keywords:  reporter-feedback close =>


Comment:

 @desrosj googling for "firefox bugzilla css animation cpu"
 [https://www.google.com/search?sxsrf=ALeKk035PKZ_6k_bxHLG7vDutgQpcEK3pg%3A1600239729433&ei=cbhhX6uCGo_7kwXOqoy4DA&q=firefox+bugzilla+css+animation+cpu&oq=firefox+bugzilla+css+animation+cpu&gs_lcp=CgZwc3ktYWIQAzoECCMQJzoECCEQClDVf1jlogFg3aQBaABwAHgBgAF5iAGhEJIBBDEyLjmYAQCgAQGqAQdnd3Mtd2l6wAEB&sclient
 =psy-ab&ved=0ahUKEwjr_oLFje3rAhWP_aQKHU4VA8cQ4dUDCA0&uact=5 returns some
 related bug reports] on the bugzilla bug tracker.

 For the records, historically Firefox had problems also with animated
 GIFs, see googling for
 [https://www.google.com/search?sxsrf=ALeKk00pggRbyYFLCBDusYx4Ud_1b6U3FQ%3A1600239720433&ei=aLhhX8-MGsi0kwW8u5WgDA&q=firefox+bugzilla+animated+gif+cpu&oq=firefox+bugzilla+animated+gif+cpu&gs_lcp=CgZwc3ktYWIQAzoECCMQJzoFCCEQoAFQyTVY_ztgwEBoAHAAeACAAXiIAYkEkgEDMi4zmAEAoAEBqgEHZ3dzLXdpesABAQ&sclient
 =psy-ab&ved=0ahUKEwjP4N3Aje3rAhVI2qQKHbxdBcQQ4dUDCA0&uact=5 "firefox
 bugzilla animated gif cpu"].

 Spinner icons and animated GIFs already cause problems in the past, see
 for example #33322. I guess this is no different for CSS animations.

 > is there any way to confirm that the ~20% CPU increase is being caused
 by the animation itself and not the fact that the window begins
 downloading and processing the audio file?

 Test it and hide the animated element with `display: none` or removing it
 from the DOM? :) As I wrote in the ticket description: "Removing that
 element from the DOM makes the CPU usage go down to 0".


 > Also, can you confirm that this does not just happen in the Classic
 Editor, but in the block editor and on the front-end as well?

 If the animation is shown, I don't see why it should not happen also
 there.


 > I'm not sure how this could be improved on WordPress' side of things
 without a change upstream

 Hiding the animated element with `display: none` should work. Reporting
 upstream and asking for a fix is also an option.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/32597#comment:6>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list