Closed Bug 1700079 Opened 4 years ago Closed 4 years ago

Use lazy getters to avoid loading Log.jsm / TelemetryController.jsm earlier than necessary from CrashManager.jsm

Categories

(Toolkit :: Crash Reporting, task)

task

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: standard8, Assigned: standard8)

References

Details

(Keywords: perf)

Attachments

(1 file)

Looking at a profile for Thunderbird, I noticed that CrashManager.jsm is doing two unnecessary things:

  • Initialising a logging module, when it is only used for some warning messages.
  • Loading TelemetryController.jsm via a direct import rather than a lazy loader. Making this lazy only delays loading of TelemetryController.jsm by a few ms, but means it is first loaded via TelemetryStartup, which seems more appropriate.

This won't save much in terms of time, maybe a little in memory.

Chris, in investigating this change Andrew noticed that this would mean TelemetryController.jsm is not loaded on Fenix (at least not during startup). It seems that TelemetryStartup.jsm is not fired there.

Do you know if that is expected / acceptable?

Flags: needinfo?(chutten)
Attachment #9210746 - Attachment description: Bug 1700079 - Use lazy getters in CrashManager.jsm to avoid loading/initialising items unnecessarily. rflorian → Bug 1700079 - Use lazy getters in CrashManager.jsm to avoid loading/initialising items unnecessarily.

Hm. I thought TelemetryController was already not being loaded in Fenix. Telemetry doesn't work in Fenix, it has Glean which is much better. This change brings reality more in line with my imagination, so I definitely approve : )

Flags: needinfo?(chutten)
Assignee: nobody → standard8
Status: NEW → ASSIGNED
Pushed by mbanner@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e41fd0c1f392 Use lazy getters in CrashManager.jsm to avoid loading/initialising items unnecessarily. r=florian
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: