Closed Bug 652808 Opened 9 years ago Closed 2 years ago

Avoid loading, during startup, images that don't appear on UI

Categories

(Firefox :: Theme, defect)

defect
Not set

Tracking

()

RESOLVED DUPLICATE of bug 1363059

People

(Reporter: glandium, Unassigned)

Details

I think this is worth investigating. There are a bunch of images that are not displayed until well after startup that are loaded during startup, starting with the personas footer image, when there is no addon or status bar displayed, as per the default UI. They should either be consolidated in image maps or avoided altogether where possible.

FWIW, a list of the images loaded during Linux startup, with no session restored:
chrome://browser/skin/Go-arrow.png
chrome://browser/skin/places/starPage.png
chrome://browser/skin/places/toolbarDropMarker.png
chrome://browser/skin/reload-stop-go.png
chrome://browser/skin/tabbrowser/tabDragIndicator.png
chrome://browser/skin/tabbrowser/tab-overflow-border.png
chrome://browser/skin/tabbrowser/tab.png
chrome://browser/skin/Toolbar.png
chrome://browser/skin/Toolbar-small.png
chrome://global/skin/arrow/arrow-dn-dis.gif
chrome://global/skin/arrow/arrow-dn.gif
chrome://global/skin/arrow/arrow-lft-dis.gif
chrome://global/skin/arrow/arrow-lft.gif
chrome://global/skin/arrow/arrow-rit-dis.gif
chrome://global/skin/arrow/arrow-rit.gif
chrome://global/skin/arrow/arrow-up-dis.gif
chrome://global/skin/arrow/arrow-up.gif
chrome://global/skin/icons/autoscroll.png
chrome://global/skin/icons/resizer.png
chrome://global/skin/scrollbar/slider.gif
chrome://global/skin/toolbar/chevron.gif
data:image/png;base64,AAABAAEAEBAAAAEAGABoAwAAFgAAACgAAAAQAAAAIAAAAAEAGAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADs9Pt8xetPtu9FsfFNtu%2BTzvb2%2B%2Fne4dFJeBw0egA%2FfAJAfAA8ewBBegAAAAD%2B%2FPtft98Mp%2BwWsfAVsvEbs%2FQeqvF8xO7%2F%2F%2F63yqkxdgM7gwE%2FggM%2BfQA%2BegBDeQDe7PIbotgQufcMufEPtfIPsvAbs%2FQvq%2Bfz%2Bf%2F%2B%2B%2FZKhR05hgBBhQI8hgBA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AAfYAAO4AAACAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAQAA
file:///home/mh/.mozilla/firefox/vvqprs49.5.0/lightweighttheme-footer?33;
file:///home/mh/.mozilla/firefox/vvqprs49.5.0/lightweighttheme-header?33;
moz-icon://stock/gtk-add?size=menu
moz-icon://stock/gtk-close?size=menu
moz-icon://stock/gtk-file?size=menu
moz-icon://stock/gtk-find?size=menu
moz-icon://stock/gtk-go-back-ltr?size=toolbar&state=disabled
moz-icon://stock/gtk-go-forward-ltr?size=toolbar&state=disabled
moz-icon://stock/gtk-home?size=toolbar
moz-icon://stock/gtk-refresh?size=toolbar&state=disabled
moz-icon://stock/gtk-stop?size=toolbar&state=disabled

This can be obtained with NSPR_LOG_MODULES=imgRequest:5 and looking for "imgLoader::LoadImage (aURI="
I have to verify my benchmark, but I apparently gain between 1 and 2 % on warm startup by only avoiding a very few of these images, namely:
chrome://browser/skin/Go-arrow.png
chrome://browser/skin/places/toolbarDropMarker.png
chrome://browser/skin/tabbrowser/tabDragIndicator.png
chrome://browser/skin/tabbrowser/tab-overflow-border.png
chrome://browser/skin/Toolbar-small.png
(In reply to comment #1)
> I have to verify my benchmark, but I apparently gain between 1 and 2 % on warm
> startup

I should verify my math, too, that was between 2 and 4 % (between 10 and 20ms off 500ms).
So how do you avoid loading these images during startup?
Component: General → Theme
QA Contact: general → theme
Let's not pretend I'm working on this :)
This seems to still be true 6 years later, though. At least for chrome://browser/skin/tabbrowser/tabDragIndicator.png and chrome://browser/skin/places/toolbarDropMarker.png.

Florian, is this something you'd like to look at?
Assignee: mh+mozilla → nobody
Flags: needinfo?(florian)
(In reply to Mike Hommey [:glandium] from comment #4)
> Let's not pretend I'm working on this :)
> This seems to still be true 6 years later, though. At least for
> chrome://browser/skin/tabbrowser/tabDragIndicator.png and
> chrome://browser/skin/places/toolbarDropMarker.png.
> 
> Florian, is this something you'd like to look at?

In bug 1363059 johannh put in place an automated test to track these images (browser/base/content/test/performance/browser_startup_images.js). This should ensure the list shrinks.
Status: NEW → RESOLVED
Closed: 2 years ago
Flags: needinfo?(florian)
Resolution: --- → DUPLICATE
Duplicate of bug: 1363059
You need to log in before you can comment on or make changes to this bug.