Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What causes this warning on Safari? "This webpage is using significant energy. Closing it may improve the responsiveness of your Mac"

We have a React website running with lots of high-quality images that has been experiencing this warning. How do you begin debugging this warning message on Safari? Is there specific things that cause this?

Safari warning

like image 852
Thomas Wang Avatar asked Nov 24 '18 02:11

Thomas Wang


People also ask

How do I fix Safari with significant energy?

Empty Safari's cache and cookies Go to Safari ➙ Preferences in the menu bar (or use ⌘ + ,). Navigate to the Advanced tab and check the box "Show Develop menu in menu bar." Now select the Develop menu in the Menu bar and click on Empty Caches. Restart Safari to make sure the cache is clear.

Why does Safari use significant energy on a Macbook?

If Safari is out of date, it's possible that the warning was caused by an incompatibility with an element on the web page. Try installing any outstanding updates under System Preferences > Software Update and trying again. There are a few other things that you can try to improve Safari stability, too.

How do I fix a website using significant memory on my Mac?

The major ways to Fix “This Webpage is using Significant Memory in Safari” are close less useful tabs, delete cache and browser data, disable plugins, Force quit Safari, and use a content and ad Blocker, upgrade RAM, update Safari and macOS, and Check for Mining Scripts.


1 Answers

This message is caused by Safari watchdog process that monitors the Javascript scripts running on a page. It is there to notify the user when a script is utilizing too many resources. Your page when loaded on my computer raises the CPU utilization to 68 percent. Be weary of loops and custom render code.

Notes for improvement:

  • Make the rendering code as efficient as possible.

  • Combine the your internal Javascript files into a single file, instead of 7 files. Major improvement.

  • When possible(due to licensing and update considerations) include the 9 external scripts into the single file stated above. Minor improvement.

  • Split the main page into different sections either as separate pages or dynamically loaded using AJAX. Major improvement.

  • Avoid svg files. SVG files require a lot of computing power to rasterize and display. This is the main cause of the 7 second load times. Convert the files to png at the largest expected display resolution and offer an expanded SVG file if more detail is wanted(by click or delayed mouse over). Major improvement.

The number of images is not the issue. It is the number of SVG images(on load) and the scripts causing the issue.

like image 88
Strom Avatar answered Sep 29 '22 00:09

Strom