Why is Firefox so slow ?

I recently upgraded to 13.0-RELEASE-p3. I have a 64-bit Dell Inspiron laptop, running on an AMD E2 7th gen processor and 4 GB DDR4 RAM.

My Firefox version was also updated to 91.0. But all pages load very slowly. Ordinary news and e-commerce sites take upto a minute to load. The same pages load within 4 or 5 seconds on my Windows laptop, which is connected to the same Wi-Fi network as the FreeBSD laptop is.

Do I have to change some settings to enable Firefox to run normally ? Is my hardware configuration inadequate ?
 
I have only recently started using FreeBSD as a desktop OS but I am not experiencing any performance issues with FireFox on any of my machines.

You could fire up the developer tools and look at the corresponding tab reporting loading times/speeds (the waterfall thing). This could give some insights as to what is causing the hold-ups (i.e. networking fetching, rendering, script stuff, ...).
 
I recently upgraded to 13.0-RELEASE-p3. I have a 64-bit Dell Inspiron laptop, running on an AMD E2 7th gen processor and 4 GB DDR4 RAM.

My Firefox version was also updated to 91.0. But all pages load very slowly. Ordinary news and e-commerce sites take upto a minute to load. The same pages load within 4 or 5 seconds on my Windows laptop, which is connected to the same Wi-Fi network as the FreeBSD laptop is.

Do I have to change some settings to enable Firefox to run normally ? Is my hardware configuration inadequate ?
This is due to having a system with quarterly software support, when it is always advisable to have a system with the latest, healthy to avoid vulnerabilities or system failures when updating or precompiling a port, today the Firefox browser is on version 92.
 
Check if IPv6 is enabled and working properly. If IPv6 is enabled but not working correctly you get various timeouts as the requests will be made on IPv6 first before it falls back to IPv4. That causes a number of annoying delays when browsing.
 
I recently upgraded to 13.0-RELEASE-p3. I have a 64-bit Dell Inspiron laptop, running on an AMD E2 7th gen processor and 4 GB DDR4 RAM.

My Firefox version was also updated to 91.0. But all pages load very slowly. Ordinary news and e-commerce sites take upto a minute to load. The same pages load within 4 or 5 seconds on my Windows laptop, which is connected to the same Wi-Fi network as the FreeBSD laptop is.

Do I have to change some settings to enable Firefox to run normally ? Is my hardware configuration inadequate ?
It is hard to tell, given only this information. See top in a terminal window when it is loading the page. Also try www/chromium with the same page. Is it only Firefox slow or Chromium also? IP misconfiguration has been suggested here. See if your memory is not full.
Personally, I am a long time desktop user of FreeBSD, I have Firefox, Chromium and Konqueror browsers installed. All of these feel good.
 
I'm also on quarterly. FreeBSD 13.0-RELEASE-p4 and Firefox 92.0.1. Everything seems to be running briskly. Recently I was on Firefox 91, and thought it might have been a somewhat flaky version. Please try running freebsd-update and pkg update && pkg upgrade again, and see if your problems still persist.

Edited to add: I was assuming you're using packages when I wrote the above. If you're mixing ports and packages, please consider switching from quarterly to latest in order to better synchronize packages with ports.
 
This is probably not an issue with Firefox.

You might find a wired connection much faster.


Without knowing the hardware: I should assume that it's driven slowly by FreeBSD.

Improved support for Wi-Fi is on the roadmap.




If you still suspect an issue with Firefox, please share More Troubleshooting Information; copy text (not raw data) and paste here as code. Thanks.
 
I thank all of you for your valuable suggestions. I followed all of them and here is what I found:
  1. My Firefox has enabled IPv6 by default.
  2. Using the developer tools of Firefox, the pyramid keeps on extending for many seconds (especially while loading DoM components).
  3. However, the top command may indicate some heavy usage by Firefox. I loaded Facebook.com and Firefox's consumption fluctuates between 84%, 34% and 10% before settling down to < 1%. This takes a very long time. I have only 2 tabs open currently.
  4. So now I am executing freebsd-update and pkg update && pkg upgrade. The packages are downloading at 50 to 100 KBps. So this may be a problem with FreeBSD.
I will definitely test the system after the upgrade and inform here.
 
Using the developer tools of Firefox, the pyramid keeps on extending for many seconds (especially while loading DoM components).
This is an issue with Facebook, not Firefox or FreeBSD. Facebook loads tons of crap when you visit their web pages.


the top command may indicate some heavy usage by Firefox. I loaded Facebook.com
Same thing.

The packages are downloading at 50 to 100 KBps. So this may be a problem with FreeBSD.
No. Unless you are saying it's a configuration problem with your network settings.

I have a 32-bit Dell Inspiron that's obviously very old and I use it for backups. It has no issues with updating packages and I check it and do that every day.
 
Hello all. After updating and upgrading my FreeBSD, I can report the following:
  1. Firefox has been updated to version 93. There has indeed been a marked improvement in loading of "heavy" pages like Facebook, LinkedIn and some news sites etc. Instead of 1+ minute earlier, they now load in about 15 seconds.
  2. I have not changes any configurations of my Wi-Fi router. By the way I forgot to mention that it also serves 2 TVs running on Amazon Firestick simultaneously and quite smoothly.
It seems after the upgrade, something's changed for the better. Is it Firefox or FreeBSD itself, I cannot say.

I'll keep monitoring the speed at random times during the day.

No. Unless you are saying it's a configuration problem with your network settings.
drhowarddrfine, I doubt it because my Wi-Fi router also serves other devices like TVs and a Windows laptop, in which I seldom notice a slow performance. Yes, sometimes it disconnects but that's a rare occurrence during any day.
 
Update after 2 days: Well, so far so good. Most "heavy" sites like LinkedIn, Facebook and e-commerce sites load within approximately 10 seconds on Firefox. I also tried to simultaneously load any 2 of these sites on 2 tabs. The result is the same.

PS: I also tried WebKitGtk browser. I was surprised that it was a couple of notches faster than Firefox. So, could the speed difference be due to the cache and cookies that have accumulated in Firefox over time ?
 
Quite often the reason for slow browsing can be DNS issues. Recently they changed Firefox to automatically use encrypted DNS and bypass the system's DNS facilities, which cannot have made it quicker.
You could do the following test:
To use a locally running Unbound for resolving put

nameserver 127.0.0.1

into /etc/resolv.conf
(and remember to comment out the other nameservers)
Then:
Bash:
sysrc local_unbound_enable=YES
service local_unbound start
Please do report if the DNS tweaks help speed up browsing.

P.S. You can also do a quick test and use another browser (like www/chromium) and also a text-based browser like www/lynx and compare the performance with Firefox.
 
In case you are behind a router, then may be you could update its firmware, reset it to factory settings and reconfigure it. You could disable ipv6 on your LAN (by disabling dhcp6 on your router) and see if that speeds up loading times.
 
Update after 2 days: Well, so far so good. Most "heavy" sites like LinkedIn, Facebook and e-commerce sites load within approximately 10 seconds on Firefox. I also tried to simultaneously load any 2 of these sites on 2 tabs. The result is the same.

PS: I also tried WebKitGtk browser. I was surprised that it was a couple of notches faster than Firefox. So, could the speed difference be due to the cache and cookies that have accumulated in Firefox over time ?

> Menu: History > Select: Clear Recent History... >

Screenshot at 2021-10-05 01-08-33.png
 
Quite often the reason for slow browsing can be DNS issues. Recently they changed Firefox to automatically use encrypted DNS and bypass the system's DNS facilities, which cannot have made it quicker.
You could do the following test:

(and remember to comment out the other nameservers)
Then:
Bash:
sysrc local_unbound_enable=YES
service local_unbound start
Please do report if the DNS tweaks help speed up browsing.

P.S. You can also do a quick test and use another browser (like www/chromium) and also a text-based browser like www/lynx and compare the performance with Firefox.
As Vull suggested, I cleared all my cache and cookies and noticed a jump of a few seconds in loading times. Facebook loaded in 5 seconds, and LinkedIn took about 10 seconds.

I did your steps. Firstly, the DNS settings were already disabled in Firefox as shown in the screenshot below:
1633616379800.png

Then I activated a local DNS cache with unbound according to the steps you mentioned. With these steps, there was no noticeable increase in loading speed as when I got after clearing the cache and cookies.

grahamperrin, I created a new profile as you suggested, but again I did not see any improvement over and above I had after clearing the cache and cookies. In fact it was noticeable much slower. This did not have the UserAgent plugin at all. Normally I use this to spoof ordinary sites, disguised as Chrome running on Windows (or Opera on Mac) etc. Otherwise, they often don't work saying that, "This browser isn't recognized," or "We detected some suspicious activity".

bu_mi, I haven't tried your suggestion yet for fear of disrupting other devices connected to it.

Summary so far: Overall, the biggest change came on Monday, 4th October after updating and upgrading FreeBSD. FireFox also got upgraded to version 93 from 91 earlier. Today, after clearing the cache and cookies also there was some slight uptick in some sites. Activating a local DNS cache with unbound did not bring about a noticeable change from what I already did.
 

Attachments

  • 1633614798400.png
    1633614798400.png
    46.4 KB · Views: 65
Summary so far: Overall, the biggest change came on Monday, 4th October after updating and upgrading FreeBSD. FireFox also got upgraded to version 93 from 91 earlier. Today, after clearing the cache and cookies also there was some slight uptick in some sites. Activating a local DNS cache with unbound did not bring about a noticeable change from what I already did.
It looks like DNS was not the cause of your issues. Just to be on the safe side, post the output of this command: drill www.facebook.com. The command will show how fast the DNS query was executed. Then you can try with drill @8.8.8.8 www.facebook.com, which will use Google's DNS server instead of your local DNS cache. And as a third test you can replace the "8.8.8.8" with the IP address of your LAN's DNS - that's probably your router or whatever your provider sets for you.
If the times shown are below 50-100 ms I think it's acceptable. Of course, 20-30 ms would be snappier. And the local DNS should almost always show "0 ms" - it's fast because it does not go over the network.

Another idea - maybe it comes from your browser. Have you installed any add-ons? I would disable all extensions and all add-ons and try with a pure browser. You can even try and create a completely new profile (your profile is stored in ~/.mozilla/firefox). Move the profile and let Firefox create a new one from scratch. This will initialize your browser with factory settings.

Also, try another browser like Chromium and compare the speeds.
 
Back
Top