Closed Bug 1861822 Opened 4 months ago Closed 28 days ago

Firefox takes a while to cold boot

Categories

(Core :: Storage: Quota Manager, defect)

Firefox 119
defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: brawaru, Unassigned)

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/119.0

Steps to reproduce:

  1. Close Firefox
  2. Log out and back in to your Windows account / Restart your computer
  3. Launch Firefox again

Actual results:

Firefox launches, shows all the extensions and tabs, but everything appears to be loading for the duration of between 3 to 5 minutes. The tabs are empty and only show loading indicator, extensions don't react to clicks and have default stateless icons.

According to the profile Firefox spends the entirety of this time on the following stacks (several times):

ZwWaitForAlertByThreadId [ntdll.dll]
RtlSleepConditionVariableSRW [ntdll.dll]
SleepConditionVariableSRW [KERNELBASE.dll]
mozilla::detail::ConditionVariableImpl::wait(mozilla::detail::MutexImpl&) [mozglue/misc/ConditionVariable_windows.cpp]
mozilla::OffTheBooksCondVar::Wait() [xpcom/threads/CondVar.h]
mozilla::TaskController::GetRunnableForMTTask(bool) [xpcom/threads/TaskController.cpp]
nsThread::ProcessNextEvent(bool, bool*) [xpcom/threads/nsThread.cpp]
NS_ProcessNextEvent(nsIThread*, bool) [xpcom/threads/nsThreadUtils.cpp]
TaskController::GetRunnableForMTTask::Wait
mozilla::ipc::MessagePump::Run(base::MessagePump::Delegate*) [ipc/glue/MessagePump.cpp]
MessageLoop::RunInternal() [ipc/chromium/src/base/message_loop.cc]
MessageLoop::RunHandler() [ipc/chromium/src/base/message_loop.cc]
MessageLoop::Run() [ipc/chromium/src/base/message_loop.cc]
nsBaseAppShell::Run() [widget/nsBaseAppShell.cpp]
nsAppShell::Run() [widget/windows/nsAppShell.cpp]
XRE_RunAppShell() [toolkit/xre/nsEmbedFunctions.cpp]
mozilla::ipc::MessagePumpForChildProcess::Run(base::MessagePump::Delegate*) [ipc/glue/MessagePump.cpp]
MessageLoop::RunInternal() [ipc/chromium/src/base/message_loop.cc]
MessageLoop::RunHandler() [ipc/chromium/src/base/message_loop.cc]
MessageLoop::Run() [ipc/chromium/src/base/message_loop.cc]
XRE_InitChildProcess(int, char**, XREChildData const*) [toolkit/xre/nsEmbedFunctions.cpp]
mozilla::BootstrapImpl::XRE_InitChildProcess(int, char**, XREChildData const*) [toolkit/xre/Bootstrap.cpp]
XRE_InitChildProcess
content_process_main(mozilla::Bootstrap*, int, char**) [ipc/contentproc/plugin-container.cpp]
NS_internal_main(int, char**, char**) [browser/app/nsBrowserApp.cpp]
wmain(int, wchar_t**) [toolkit/xre/nsWindowsWMain.cpp]
invoke_main() [/builds/worker/workspace/obj-build/browser/app/D:/a/_work/1/s/src/vctools/crt/vcstartup/src/startup/exe_common.inl]
__scrt_common_main_seh() [/builds/worker/workspace/obj-build/browser/app/D:/a/_work/1/s/src/vctools/crt/vcstartup/src/startup/exe_common.inl]
BaseThreadInitThunk [KERNEL32.DLL]
RtlUserThreadStart [ntdll.dll]
(root)

Expected results:

Firefox should launch and become interactive in a time comparable or better than Chromium browsers, which become interactive in less than a minute in worst case scenario, but usually in around just 5-10 seconds.

Just for additional context: this issue has happening for a long time but I had no clue how to report or diagnose it. Someone on Mastodon suggested me to take a profile, which I couldn't manage to do before under the impression that you need to start profiling before you restart Firefox, but it seems that just pressing the button after launching works.

I recently completely reinstalled my Windows (moved to Windows 11) and Firefox, but I migrated my profile folder over. I also have HDD, and when Firefox loads like this, the disk usage stays at 100% the entire time. Looking through resource manager, Firefox seems to be accessing a lot of random profile files.

Component: Untriaged → Performance
Product: Firefox → Core

This bug was moved into the Performance component.

:dafri.nochiterov8, could you make sure the following information is on this bug?

  • For slowness or high CPU usage, capture a profile with http://profiler.firefox.com/, upload it and share the link here.
  • For memory usage issues, capture a memory dump from about:memory and attach it to this bug.
  • Troubleshooting information: Go to about:support, click "Copy raw data to clipboard", paste it into a file, save it, and attach the file here.

If the requested information is already in the bug, please confirm it is recent.

Thank you.

Flags: needinfo?(dafri.nochiterov8)
Attached file about_support.json

about:support contents

Hi! Here's the profile: https://share.firefox.dev/3SnAOW9. Attached about:support as well (not sure if I did it right).

Flags: needinfo?(dafri.nochiterov8)

Hey Sasha, I'm wondering if something is just wonky inside your profile and may benefit from a refresh. Could you try refreshing your profile and see where that gets you? (And report back here regardless! :))

Flags: needinfo?(dafri.nochiterov8+mozbugzilla)

Hey. I've previously considered refreshing the profile or re-create my profile from scratch again, but ultimately decided against that because I just don't have time and energy to set up everything again.

HOWEVER, after checking which files Firefox accesses during these 3+ minutes, it looked like cache (morgue something, bunch of files with domain.name+++stuff). So I went to settings and cleared all cache and offline site data. It took almost the same amount of time as it took for Firefox to boot, and during that time I couldn't use it at all - pages wouldn't load, extensions wouldn't react. But I believe that I cannot reproduce this anymore, at least not to that extent (it still takes a bit to load).

The question though: why does Firefox indefinitely stores cache / offline site data (especially the sites that you accessed only like once), and why does it access all of it during the boot? No wonder it takes a while on a poor HDD.

Flags: needinfo?(dafri.nochiterov8+mozbugzilla)
Component: Performance → Storage: Quota Manager

(In reply to Sasha Sorokin [:brawaru] from comment #6)

Hey. I've previously considered refreshing the profile or re-create my profile from scratch again, but ultimately decided against that because I just don't have time and energy to set up everything again.

HOWEVER, after checking which files Firefox accesses during these 3+ minutes, it looked like cache (morgue something, bunch of files with domain.name+++stuff). So I went to settings and cleared all cache and offline site data. It took almost the same amount of time as it took for Firefox to boot, and during that time I couldn't use it at all - pages wouldn't load, extensions wouldn't react. But I believe that I cannot reproduce this anymore, at least not to that extent (it still takes a bit to load).

The question though: why does Firefox indefinitely stores cache / offline site data (especially the sites that you accessed only like once), and why does it access all of it during the boot? No wonder it takes a while on a poor HDD.

Probably this bug is fixed in 122[1] although it is difficult to say to what extent it will be felt on HDD.

  1. https://bugzilla.mozilla.org/show_bug.cgi?id=1866240

Hi :brawaru, bug 1866240 is shipping now to the upcoming 122 release. Once you updated, can you please confirm if it helped? Although if I read comment 6 right, you already cleaned your profile and you might just want to close this bug WORKSFORME. Thank you for your support!

Flags: needinfo?(dafri.nochiterov8+mozbugzilla)

Though my issue mostly went away after clearing cache and offline site data, I do think that 122 helped even further. Firefox now takes about 10 seconds to start with all the extensions and pinned tabs, on a good ol' HDD, after a cold boot. And almost no time during subsequent restarts. Great stuff! 👍 And sure, I'll go ahead and close this as resolved now, ty! :)

Status: UNCONFIRMED → RESOLVED
Closed: 28 days ago
Flags: needinfo?(dafri.nochiterov8+mozbugzilla)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.