Live data from Hacker News

Why are browsers so slow?

ilyabirman.net

351–360 of 376 posts

Re: Why are browsers so slow?

#351
post #193

Earlier quoted context omitted.

I think that the mechanism I suggested elsewhere would handle this best: each tab's complete state (DOM, JavaScript &c.) should be marshalled to disk at quit (and checkpointed periodically, in case of crashes); on startup, all tabs are loaded and their DOM & JavaScript contexts restored. If a tab's context had it set to update periodically, then that periodic-update context would be restored; if not, then the remote…

> This seems so obviously correct to me that I wonder what I'm missing. You are missing that > should be marshalled to disk at quit is not easily doable.

Why not? The DOM is, ultimately, just HTML. The VM state is just data in RAM, which should be eminently serialisable.

I'd think it's the sort of thing which ought to be child's play.

Re: Why are browsers so slow?

#352

Earlier quoted context omitted.

This is mostly because Chrome starts a new process for each tab. However, Firefox is also heading in this direction.

Firefox is going for at most N+1 cores worth of processes, as I understand it (one per core for websites and one extra for compositing and the UI) and is doing to use cooperative threading (Quantum DOM) to improve responsiveness within those processes without the overhead of running a process per website.

Alright, good to know. I had the idea that they were going in the same direction as Chrome.

Re: Why are browsers so slow?

#353

Earlier quoted context omitted.

> 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…

400 tabs. Including several active fancy SPAs, like gMail and two copies of Slack, a gDocs or two, sometimes the godawful work LMS. Stock Firefox 50 (32bit), untweaked with no relevant add-ons (well, except AdBlock Plus), Windows 10, just over 400 tabs open, under 10% CPU, under 2GB of RAM (on a 16GB machine). If I freak it out by doing a bunch of flipping through dormant tabs, I can spike CPU pretty good as it does…

> Why do people use Chrome, again?

Oh you are like my mother. I do appreciate Firefox respect for standards, but their UI hasn't innovated since 90s. Two months ago it took me 20 minutes on my moms Windows laptop to find current version of Firefox! It lacks unified search bar, tab expose, even some basic hotkeys are backwards.

I can't believe it uses so little resources though. It's not uncommon to see a single tab use 400 MB of memory on Chrome/Safari.

Re: Why are browsers so slow?

#354

> 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…

Same here, at the start of August I had a total of around 350 tabs, divided into 8 groups according to topics (General, Entertainment, GitHub, Firefox Dev, GNOME Dev, Thesis, Interview Preps etc.) and my CPU idled at around 4% (2.2GHz - 2.7GHz i5 laptop) with RAM at around 1.6GB when started and routinely reached 3GB by the end of the day. It did occansionally crash the tabs while switching between too many YouTube tabs too fast. Took about 4 seconds to start a new instance (meaning that getting a usable instance, the UI came in under 2 secs), shutdown instantly.

Re: Why are browsers so slow?

#355

Earlier quoted context omitted.

400 tabs. Including several active fancy SPAs, like gMail and two copies of Slack, a gDocs or two, sometimes the godawful work LMS. Stock Firefox 50 (32bit), untweaked with no relevant add-ons (well, except AdBlock Plus), Windows 10, just over 400 tabs open, under 10% CPU, under 2GB of RAM (on a 16GB machine). If I freak it out by doing a bunch of flipping through dormant tabs, I can spike CPU pretty good as it does…

>400 tabs >like gMail and two copies of Slack, a gDocs or two, sometimes the godawful work LMS. >under 10% CPU, under 2GB of RAM Any proofs? Stock firefox can't go further than 100 tabs, and you can't do literally anything else on your computer at that time.

I have stock on 153 tabs with two processes each using 670MB of memory (1.3 GB total) and CPU is at a comfortable 1.5% + 0.9% (2.4%).

EDIT: Oh, I do have 22 extensions installed.

[1]: http://i.imgur.com/Epkfydj.png

Re: Why are browsers so slow?

#356
post #164

Earlier quoted context omitted.

AKA: the alpha :) Credit to them though, Aurora was surprisingly stable for most of its lifetime, despite not even being a beta.

Even more impressive, the Nightly versions of both Chrome and Firefox are (almost always) stable enough for daily use. I use them as my everyday browsers at work, and they probably crash / have bugs about 1 day out of every 2 months.

I started using Nightly for kicks and giggle around 6 months ago and my about:crashes shows me only 6 crashes (none of which were able to kill anything more than a tab (and in all the cases, the offending website was YouTube)).

Nightly is amazingly good even if it is built from the HEAD of the trunk (branch in git terms).

Re: Why are browsers so slow?

#357
post #351

Earlier quoted context omitted.

> This seems so obviously correct to me that I wonder what I'm missing. You are missing that > should be marshalled to disk at quit is not easily doable.

Why not? The DOM is, ultimately, just HTML. The VM state is just data in RAM, which should be eminently serialisable. I'd think it's the sort of thing which ought to be child's play.

The VM state isn't that easy when you remember that JS can keep open sockets to other things, can launch processes, etc.

Sure, you could find a way to serialize it, but that'd be a lot harder — you can't hust go back to halfway the middle of receiving something through a socket.

Re: Why are browsers so slow?

#358
post #351

Earlier quoted context omitted.

Why not? The DOM is, ultimately, just HTML. The VM state is just data in RAM, which should be eminently serialisable. I'd think it's the sort of thing which ought to be child's play.

The VM state isn't that easy when you remember that JS can keep open sockets to other things, can launch processes, etc. Sure, you could find a way to serialize it, but that'd be a lot harder — you can't hust go back to halfway the middle of receiving something through a socket.

One could just close open connexions — after all, a network connexion can always die anyway.

I really hope that JavaScript in a browser can't launch processes!

Re: Why are browsers so slow?

#359
post #169

Earlier quoted context omitted.

Try uBlock Origin. It performs even better than ABP, and hasn't sold out.

Can we stop the "sellout" business? Having a clearly stated and one-click reversible whitelist is neither dishonest nor bad for the user. I like having the option to support sites I enjoy without massively inconveniencing myself. You prefer maximum adblocking, and that's fine, but there's nothing at all wrong with giving us both the choice.

> I like having the option to support sites I enjoy without massively inconveniencing myself.

So do I, which is why I use Patreon and subscriptions.

The side effects of viewing ads are that in addition to supporting the sites you enjoy, you're supporting malware distributors, and helping companies compete on ads rather than the quality of their products. Maybe you don't care about your own attention or data security, but your actions don't just affect you.

Re: Why are browsers so slow?

#360
post #291

Earlier quoted context omitted.

Yes, IIRC. They're still imperfect and can lag the browser quite a bit IME, but what can you do... Switching to a different password manager is not easy, and the ones I've looked at all have this/other problems.

SafeInCloud. That's what one can do.

I think those of us using LastPass stick with it because no one better supports Linux. It looks like SafeInCloud is yet another option with no Linux support.
Post reply on HN