Slashdot Asks: Why Are Browsers So Slow? (ilyabirman.net)
Designer Ilya Birman writes: I understand why rendering a complicated layout may be slow. Or why executing a complicated script may be slow. Actually, browsers are rather fast doing these things. If you studied programming and have a rough idea about how many computations are made to render a page, it is surprising the browsers can do it all that fast. But I am not talking about rendering and scripts. I am talking about everything else. Safari may take a second or two just to open a new blank tab on a 2014 iMac. And with ten or fifteen open tabs it eventually becomes sluggish as hell. Chrome is better, but not much so. What are they doing? The tabs are already open. Everything has been rendered. Why does it take more than, say, a thousandth of a second to switch between tabs or create a new one? Opening a 20-megapixel photo from disk doesn't take any noticeable amount of time, it renders instantaneously. Browsers store their stuff in memory. Why can't they just show the pixels immediately when I ask for them? [...] Unfortunately, modern browsers are so stupid that they reload all the tabs when you restart them. Which takes ages if you have a hundred of tabs. Opera was sane: it did not reload a tab unless you asked for it. It just reopened everything from cache. Which took a couple of seconds. Modern browsers boast their rendering and script execution performance, but that's not what matters to me as a user. I just don't understand why programmers spend any time optimising for that while the Chrome is laughably slow even by ten-years-old standards.Do you agree with Birman? If yes, why do you think browsers are generally slow today?
Because we need a canvas-blocker add-on and a flash-blocker add-on and a cookie warning remover add-on and add-ons to remove all the ads on the page and we need add-ons to remove the dozens of trackers to protect our privacy and also add-ons that remove all the social buttons (twitter, FB, etc) which share our behavior even if we are not a member and add-ons that remove all the javascripts that load popups, do unwanted refreshs and Greasemonkey to make some pages readable and remove the ads that are inside the articles and we need an add-on to circumvent the anti-adblockers and .....
>Opera was sane: it did not reload a tab unless you asked for it. It just reopened everything from cache
No. That is NOT sane, normal, or desired.
Webpages are live. If I want to look at a chached version, I'll save the webpage locally. If I'm pointing a browser at an address, I expect a current webpage. If it takes all of three seconds to give me that, I think that's okay.
I agree with the summary. Basically, we have faster engines for rendering for HTML and JS, but the UI is really slow. IE family is the worst in this aspect.
On Firefox (my default browser), a nice boost in tabs rendering is made turning off the tab animation: changing "browser.tabs.animate" to false in about:config.
It's web pages that are filled with useless javascript libraries that people think they still need to use for cross-browser support even though Internet Explorer is long dead.
It's web pages that are filled with useless ads that run their own scripts, sometimes with their own libraries too, fetched from multiple servers.
It's web pages that are filled with useless tracking scripts, sometimes with their own libraries too, fetched from multiple servers.
It's web pages that are filled with huge animated GIFs that should be in video form instead.
It's web pages that are filled with auto-loading, auto-playing videos, jamming our connection to download something we don't even want to see instead of downloading the web page we're trying to read.
Disable plug-ins. Disable javascript. You'll see how fast browsers really are.
obviously don't care about painfully sluggish programs. Just look at the number of people that find Windows acceptable despite being horrifically slow. If you can get away with inefficient and poor code, why spend the extra money to hire decent programmers to make something not slow. There's no reason why Windows should take tens of minutes after boot before it becomes usable or why clicking on a Windows should usually take more than a full second, but because people keep giving Microsoft piles of cash for giving us crap, they have no reason to fix it.
Possibilities:
* You have too many slow addons enabled
* You are out of RAM
* The page is slow (big/complex)
* Your network connection is slow/saturated
* Their network connection is slow/saturated
* You are out of CPU (unlikely)
Do you agree with Birman? If yes, why do you think browsers are generally slow today?
Not really, no. Tabs open up basically instantly on the computer I'm typing this with. Doesn't matter much which browser I'm using either. I'm almost always limited either by the bandwidth of my internet connection or the slowness of the database on the other end of the line. I hear people bitching about this browser or that one being "slow" and I frankly have no idea what they are talking about. If you have an even vaguely recently built computer with reasonable hardware then it is a non problem. I also see comparisons between the browsers which claim this one or that one is faster and I simply don't see any meaningful difference. The only difference between them to me is the user interface and what bugs I run into. If there are speed differences they are simply too small for me to care.
Now he did say "hundreds of tabs" which is probably the root of the problem. My guess is that he's overtaxing his computer and running out of RAM. If you have hundreds of tabs open then you are Doing It Wrong.
I have a 2012 vintage Mac Mini and it runs just fine. Safari, Firefox, Chrome, doesn't matter. I'm typing this on a PC with a Intel i5 chip and an adequate amount of RAM and it's fine no matter what browser I use. I mostly use Firefox but I'm pretty agnostic about which browser to use as long as it works and I can block ads and trackers adequately. So no I don't think there is a problem with browser speed as a general proposition. I do think people can do stupid things that slow down browsers significantly.
Or as this article puts it more eloquently:
https://medium.com/@eshan/the-...
With open source software like Firefox it is more a failure of having the right people (engineers) at the right positions (the decision making ones). Instead they are left chasing the latest widget "feature" that no one ever asked for.
For a long time I thought that the "standard" Firefox was already bad, until I switched to my Tablet 80% of the time: Firefox for Android is just plain torture. Multiple crashes every day. Most of the time when clicking on a text field or adress bar, FF apparently hates those. other times its idling and crashes for no reason. Not to mention its hunger for memory. Unfortunately it is the only browser there that has all the features I need via addons (Mostly adblock and noscript). Opera is much better, unfortunately its adblocking is faulty and it does not recognize my hardware keyboard at all.
I remember my wikiwalks back in 2005-2007: I used to have 50-130 tabs open and nothing bad happened. That was on a Laptop from 2004 with a single core CPU. So really, it has gone downhill by orders of magnitude.
Check out the WebKit project, build it yourself, and run it under Xcode's profiling tools.
-jcr
The only title of honor that a tyrant can grant is "Enemy of the State."
Uh, I have 23 tabs open in one window and 39 in another (Vivaldi). I have a dozen open in MS Edge. Lots of them are work related or reference tabs. My Vivaldi tabs are things that I'm reading or things that I always keep open.
I'm not unusual. When I walk past other people's machines, everyone has dozens upon dozens of tabs open.
I get that I'm a huge nerd and that my use case is often niche, but browsers are just as much work tools as entertainment tools these days. It IS a useful test case. Hundreds of tabs is maybe pushing it, but it's definitely conceivable.
Most of the webpages that I have open ARE static content--they're a news story or a review or something that doesn't immediately need updating. It makes it much faster to load. Only a few things like Reddit or Facebook need a lot of refreshing.
I don't know the specific code in question, but I have seen enough code to have a theory.
Long-lived software projects that implement programs with complex features (and web browsers have an astounding array of features), especially those that interact directly with users, who put programs into a position of continually having to respond to extremely complex sets of inputs (just think of how many valid inputs there are to a web browser at any one moment), tend towards a style of implementation that can best be described as "layers upon layers upon layers of framework".
One aspect of programming that many engineers are, in my experience, not very good at, is deciding when to simplify frameworks versus making them more complex. I think it comes from a fear that many people have of painting themselves into a corner -- we've all seen code so inflexible that it makes extending it at a later time difficult, and I think that many people respond by going too far in the opposite direction - to avoid painting themselves into a corner, they put 100 doors in every room so that there is always a way out.
The end result is that every aspect of the complex program is designed to be extensible well beyond anything that will ever likely occur in practice. And the interactions between these complex layers of framework become so complex themselves that new layers have to be invented just to try to simplify things and allow any hope of rationally moving forward.
So what you end up with is incredibly deep stacks of function calls for almost any action, as various extensibility layers are passed through, along with the layers that consolidate previously implemented extensibility layers into simplified layers that more directly match the actual requirements of the program.
I have occasionally seen stack traces from programs like Firefox, and I expect Chrome is no different, and the depth of the stack at the point of a crash is always somewhat breathtaking. You may end up going 30 - 40 layers deep before you actually get to a piece of code that has a tangible effect on the state of the program.
Now imagine that a particular user input requires running through a function that has to call out to several parts of another framework layer, and you're going to be paying the deep stack penalty multiple times.
What you end up with is a large code base that does everything necessary, but in a way that is embellished to a nearly pathological degree, where every action takes 10 - 20 times longer than it would had that action been encoded much more directly and with far fewer framework layers.
The advantage of such a large code base is that it has enough flexibility to rarely, if ever, require a complete redesign as new feature requirements come up.
The disadvantage is that it will never operate as efficiently as a more directly coded program, and you get user interfaces that require executing literally billions of machine instructions just to effect fairly simple changes to its internal state machine.
That's your web browser.
I don't think that's the standard use case for testing, nor should it be. What the hell are you doing with that many tabs open.
Speak for yourself. I normally open a bunch of websites I read, and then just middle-click to open the articles I find interesting in separate tabs. You can quite easily end up with dozens of articles. I wouldn't consider that to be unusual at all.
I've done that. Even after maxing my laptop at 2 GB and replacing the HDD with an SSD, some things remain slow. The CPU graph shows one core maxed out (Firefox 50, which disables e10s because of add-ons) or both cores maxed out (Firefox 51 beta, which uses e10s), which wouldn't happen if it were swapping. I'd replace my laptop, but a new 10" has been hard to find for the past four years (except for laptops that run Chrome OS and beg the user at every boot to wipe Crouton).
What do you mean, 'slow'?
Have gnu, will travel.
Even with no-script (or especially with it as may be the case), I try to load a page. It partially works, but needs some scripts to work properly. I tell no-script to allow all this page, but then when it reloads it wants even more scripts from more places. Tell no-script OK again, and then when it reloads, it still wants more, or some of them change.
Sometimes takes 3 or 4 tries allowing and reloading just to get pages to render by the time I've approved the 50 other sites they want to load content from.
Generally speaking, I try to avoid websites that go overboard this way, but it is sadly getting to be way too common. Sometimes the no-script list is so long I have to scroll through it.........