Open Bug 1360253 Opened 3 years ago Updated 2 years ago

Use lazy MigrationUtils getter and stop using Preferences.jsm from AutoMigrate.jsm

Categories

(Firefox :: Migration, enhancement, P3)

53 Branch
enhancement

Tracking

()

People

(Reporter: Gijs, Unassigned)

References

Details

Per bug 1329712 comment #2:

(In reply to Florian Quèze [:florian] [:flo] from comment #3)
> (In reply to :Gijs from comment #2)
> > I should really just have removed this in bug 1285577, but it got missed,
> > and then I forgot I'd filed this. But AIUI we can now just request this
> > module when we need it (usually only in startup migration, or when we're
> > showing the relevant "did you want to undo this thing" notifications from
> > about:home or about:newtab).
> > 
> > Given that about:home and about:newtab still load this, it's possible
> > there's more of a perf gain to be had by making that code conditional on
> > automigration being enabled and/or lazy-ifying e.g. the MigrationUtils
> > import (which isn't necessary to just check if we're going to show the
> > notification in the common case that we won't show it).
> > 
> > Florian, is that worth pursuing in a separate bug? Don't know if you've
> > already noticed this in startup profiling or no.
> 
> Here is what I have in my existing startup profiles:
> 
> Mac: https://perfht.ml/2pltLPZ Loading AutoMigrate.jsm takes 3ms, and from
> the profile I would be tempted to say removing Preferences.jsm from that
> module (or at least from the _checkIfEnabled method) may be a good idea; but
> 1ms is just one sample, so can't say for sure.
> 
> Windows: https://perfht.ml/2plmtfc Loading AutoMigrate.jsm is visible but
> just 1ms, so not really significant.
> 
> I should have access to a reference device soon, so I'll have more detailed
> profiles.
> 
> If it's easy, lazy-ifying MigrationUtils would still be a good idea: it
> doesn't seem to be expensive in time (all the modules it imports are
> lazy-loaded), but would still save some memory.

Lazy-ifying the getter and stopping use of Preferences.jsm seems straightforward, so let's at least get that bug on file.
You need to log in before you can comment on or make changes to this bug.