Closed Bug 1627075 Opened 1 year ago Closed 11 months ago

Cache more things from omnijars with the StartupCache

Categories

(Core :: XPCOM, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla80
Tracking Status
firefox80 --- fixed

People

(Reporter: dthayer, Assigned: dthayer)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [fxperf:p2])

Attachments

(6 files)

During a startup where the StartupCache has been populated, we still read about 2MB (Edit: 4MB) jumping across the entire space of our two omnijars. If we cached more in the StartupCache by allowing caching of things loaded in background threads and child processes, we could reduce this to nearly 0.

Please note that we reorder omnijars during the build and preload parts of them on startup, but we only do so on PGO builds, so you won't see it on local builds.

Yes, I've been doing all my testing on PGO builds for that reason. (Though we generally read far more during startup than is actually included in that section.)

Also until bug 1627040 lands, we actually read the entire combined 75MB of both omnijars during startup.

(In reply to Doug Thayer [:dthayer] from comment #2)

(Though we generally read far more during startup than is actually included in that section.)

If that's the case, we should fix that.

See Also: → 1627142

Tentatively marking as p2 for now.

Whiteboard: [fxperf] → [fxperf:p2]
Blocks: 1631932
Assignee: nobody → dothayer
Status: NEW → ASSIGNED
Attachment #9153056 - Attachment description: Bug 1627075 - Build Omnijar file list from startup cache → Bug 1627075 - Build Omnijar file list from startup cache r?froydnj
Attachment #9153058 - Attachment description: Bug 1627075 - Init StartupCache before Omnijar → Bug 1627075 - Init StartupCache before Omnijar r?froydnj

Opening our Omnijars can be expensive, and it should be deferrable until after
startup is completed, provided we have a startup cache. In a previous patch in this
stack, we implemented caching of the zip central directory for omnijars, but we
still have to open the file in order to hand the object off to various omnijar
consumers. In a later patch, we will wrap nsZipArchive access in a class which
will allow us to transparently cache nsZipArchive results. These two get us
most of the way to not needing to read from the underlying omnijar files during
startup, but there are still nontrivial pieces, like nsZipFind for instance,
which we don't want to just duplicate inside of a wrapper class, so we would
like to sort out a way in which we can use an nsZipArchive class, but not
actually back it up with the real underlying file until we really need data
from it which we can't find in a cache.

Depends on D77633

Attachment #9153059 - Attachment description: Bug 1627075 - Route Omnijar requests through StartupCache → Bug 1627075 - Route Omnijar requests through StartupCache r?froydnj
Attachment #9153060 - Attachment description: Bug 1627075 - OMT and OMP StartupCache access → Bug 1627075 - OMT and OMP StartupCache access r?froydnj
Pushed by dothayer@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/763a5a7b43a0
Build Omnijar file list from startup cache r=froydnj
https://hg.mozilla.org/integration/autoland/rev/0f0d1bd2a8ac
Init StartupCache before Omnijar r=froydnj
https://hg.mozilla.org/integration/autoland/rev/6cd31f17a931
Allow lazily initializing nsZipArchives r=froydnj
https://hg.mozilla.org/integration/autoland/rev/65c0e6790a33
OMT and OMP StartupCache access r=froydnj
https://hg.mozilla.org/integration/autoland/rev/b07887474f51
Route Omnijar requests through StartupCache r=froydnj
https://hg.mozilla.org/integration/autoland/rev/cf23b456ba12
Include WebGLParent.h in WebGLChild.h r=handyman,jgilbert
Pushed by dothayer@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b6029c7c0016
Build Omnijar file list from startup cache r=froydnj
https://hg.mozilla.org/integration/autoland/rev/f5106898239f
Init StartupCache before Omnijar r=froydnj
https://hg.mozilla.org/integration/autoland/rev/6c4eedaa0d04
Allow lazily initializing nsZipArchives r=froydnj
https://hg.mozilla.org/integration/autoland/rev/ece9a4223349
OMT and OMP StartupCache access r=froydnj
https://hg.mozilla.org/integration/autoland/rev/7ae4df10749c
Route Omnijar requests through StartupCache r=froydnj
https://hg.mozilla.org/integration/autoland/rev/699212a443c3
Include WebGLParent.h in WebGLChild.h r=handyman,jgilbert
Pushed by archaeopteryx@coole-files.de:
https://hg.mozilla.org/integration/autoland/rev/9705b2759d45
Remove unused 'start' variable from startupcache/StartupCache.cpp. a=Bb-fix CLOSED TREE
Pushed by dothayer@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/ebdcd96a9d20
Build Omnijar file list from startup cache r=froydnj
https://hg.mozilla.org/integration/autoland/rev/920398d1c3d3
Init StartupCache before Omnijar r=froydnj
https://hg.mozilla.org/integration/autoland/rev/2cb021a493d8
Allow lazily initializing nsZipArchives r=froydnj
https://hg.mozilla.org/integration/autoland/rev/288a67aed661
OMT and OMP StartupCache access r=froydnj
https://hg.mozilla.org/integration/autoland/rev/a345e05df151
Route Omnijar requests through StartupCache r=froydnj
https://hg.mozilla.org/integration/autoland/rev/fc144caf5d06
Include WebGLParent.h in WebGLChild.h r=handyman,jgilbert
Pushed by dothayer@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/333d035afe92
Build Omnijar file list from startup cache r=froydnj
https://hg.mozilla.org/integration/autoland/rev/13ecd68b3c0d
Init StartupCache before Omnijar r=froydnj
https://hg.mozilla.org/integration/autoland/rev/dfd71f4ecb81
Allow lazily initializing nsZipArchives r=froydnj
https://hg.mozilla.org/integration/autoland/rev/eb5265addd5e
OMT and OMP StartupCache access r=froydnj
https://hg.mozilla.org/integration/autoland/rev/e29b15980da2
Route Omnijar requests through StartupCache r=froydnj
https://hg.mozilla.org/integration/autoland/rev/21605186687e
Include WebGLParent.h in WebGLChild.h r=handyman,jgilbert
Pushed by dothayer@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4208ed5fc3b0
Build Omnijar file list from startup cache r=froydnj
https://hg.mozilla.org/integration/autoland/rev/1d838c1c4669
Init StartupCache before Omnijar r=froydnj
https://hg.mozilla.org/integration/autoland/rev/d431b24bebf6
Allow lazily initializing nsZipArchives r=froydnj
https://hg.mozilla.org/integration/autoland/rev/d2e40366118c
OMT and OMP StartupCache access r=froydnj
https://hg.mozilla.org/integration/autoland/rev/aca7cd850cc9
Route Omnijar requests through StartupCache r=froydnj
https://hg.mozilla.org/integration/autoland/rev/4d3569a5cd9f
Include WebGLParent.h in WebGLChild.h r=handyman,jgilbert
Regressions: 1652140
Regressions: 1652143
Regressions: 1656974
Regressions: 1657205
Regressions: 1656515
Regressions: 1656261
See Also: → 1551562
You need to log in before you can comment on or make changes to this bug.