Live data from Hacker News

Why are browsers so slow?

ilyabirman.net

61–70 of 376 posts

Re: Why are browsers so slow?

#61
post #7

"Why are browsers so slow?" Site downloads almost 500KB of fonts.

THIS. If you want a fast website, remove all JS and make everything simple. For maximum performance put the static site on a CDN. It isn't hard.

This only works if you have a reasonably small site. If you have a lot of pages, like a news site, you start running up against the fact that your filesystem is not a great database. You can get a significant speedup by putting content in a database with a good index.

Re: Why are browsers so slow?

#62

> But I remember the times when we had the amazing Opera browser. In Opera, I could have a hundred open tabs, and it didn’t care, it worked incredibly fast on the hardware of its era, useless today. You may ask: why would a sane person want a hundred open tabs, how would you even manage that? Well, Opera has had a great UI for that, which nobody has ever matched. Working with a hundred tabs in Opera was much easier b…

I don't know which Firefox you're using, but I want it. Mine is super laggy all the time, even with one or two tabs open. Opening a new tab takes half a second, visiting a new page takes half a second, going back takes half a second. It's extremely frustrating to use, and I don't even have that many extensions or history pages.

Opening a tab is the fastest thing about Firefox. I mean it plays a little animation, but you can ignore that and start typing immediately after ctrl-t.

Re: Why are browsers so slow?

#63

Earlier quoted context omitted.

6 tabs, 1GB of RAM, ~20% CPU usage for me on Firefox. I have a few basic QoL plugins like LastPass, uBlock, and NoScript. It's absolutely ridiculous. I want to keep using FireFox, but it's forcing me to consider moving to another browser.

Vacuuming your profile might help: #!/bin/bash killall firefox for file in ~/.mozilla/firefox/*.default/*.sqlite; do echo sqlite3 "$file" VACUUM sqlite3 "$file" VACUUM done I do it in my once-a-month cleanup script.

I remember the days when leaving Windows meant not having to futz with cleanup scripts.

What happened?

Re: Why are browsers so slow?

#64

> But I remember the times when we had the amazing Opera browser. In Opera, I could have a hundred open tabs, and it didn’t care, it worked incredibly fast on the hardware of its era, useless today. You may ask: why would a sane person want a hundred open tabs, how would you even manage that? Well, Opera has had a great UI for that, which nobody has ever matched. Working with a hundred tabs in Opera was much easier b…

> This is exactly how I'm using Firefox, right now -- 273 tabs open. It's sitting at ~5% of CPU and 450MB of RAM. And switching tabs is instantaneous. Which platform are you on? Which Firefox version? Stock or tweaked? Any special add-ons? I use Firefox on OS X and it crawls after 10-15 tabs. Consumes many gigs of memory. Chrome isn't any better. It just splits the memory consumption among multiple processes. I don't…

I don't imagine many of those tabs are actually loaded.

Re: Why are browsers so slow?

#65
post #63

Earlier quoted context omitted.

Vacuuming your profile might help: #!/bin/bash killall firefox for file in ~/.mozilla/firefox/*.default/*.sqlite; do echo sqlite3 "$file" VACUUM sqlite3 "$file" VACUUM done I do it in my once-a-month cleanup script.

I remember the days when leaving Windows meant not having to futz with cleanup scripts. What happened?

Firefox and SQLite have actually improved a lot since those days. And it's not like Firefox uses a different database system on different platforms, it's all exactly the same.

Re: Why are browsers so slow?

#66
post #62

Earlier quoted context omitted.

I don't know which Firefox you're using, but I want it. Mine is super laggy all the time, even with one or two tabs open. Opening a new tab takes half a second, visiting a new page takes half a second, going back takes half a second. It's extremely frustrating to use, and I don't even have that many extensions or history pages.

Opening a tab is the fastest thing about Firefox. I mean it plays a little animation, but you can ignore that and start typing immediately after ctrl-t.

You can disable the animation by setting browser.tabs.animate to false in about:config.

Re: Why are browsers so slow?

#67

> But I remember the times when we had the amazing Opera browser. In Opera, I could have a hundred open tabs, and it didn’t care, it worked incredibly fast on the hardware of its era, useless today. You may ask: why would a sane person want a hundred open tabs, how would you even manage that? Well, Opera has had a great UI for that, which nobody has ever matched. Working with a hundred tabs in Opera was much easier b…

How does someone even begin to function with 273 open tabs, let alone be productive?

Re: Why are browsers so slow?

#68
post #25

Earlier quoted context omitted.

I'm assuming you don't have a GMail tab open. My Firefox memory usage steadily climbs if I have a GMail tab open.

Mmmm that's true, I don't. I tend to close GMail tabs once I'm done with them because I also noticed they tend to leak and are poorly optimized for non-Chrome browsers.

Happens to my chrome as well.

Re: Why are browsers so slow?

#69
post #67

> But I remember the times when we had the amazing Opera browser. In Opera, I could have a hundred open tabs, and it didn’t care, it worked incredibly fast on the hardware of its era, useless today. You may ask: why would a sane person want a hundred open tabs, how would you even manage that? Well, Opera has had a great UI for that, which nobody has ever matched. Working with a hundred tabs in Opera was much easier b…

How does someone even begin to function with 273 open tabs, let alone be productive?

Back when I used to use tabs as bookmarks, I would routinely get to >700 open tabs accumulating over the months. It was a useless agony. Pocket was a godsend for me. The urge to let tabs linger is still there sometimes, but it doesn't get over 20-ish nowadays. Sticking to GTD workflow helps too.

Re: Why are browsers so slow?

#70
I wrote a simple bit of code to calculate the size of index pages with includes (js, css, images) and here's what I get:

  page	  resource	total   url
  (b)	   (b)		(Kb)
  ----------------------------------------------
  33857	   143		34.0	news.ycombinator.com
  62690	   55975	118.7	arstechnica.com
  11844	   223862	235.7	seldomlogical.com
  218837   765943	984.8	newyorktimes.com
  l592771  545304	1138.1  guardian.co.uk
The one thing I notice watching the index page being broken down, is the sheer number of resources requested. Didn't bother with JS/browser interaction which you can check with browser dev tools.
Post reply on HN