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."
For one thing, users expect to see thumbnails of huge images, sync status badges on Dropbox or other online backup services, multilingual filenames written in scripts whose coverage requires multiple fonts, etc.
Yes, pages explicitly saying do-not-cache for most if not all elements by default, in order to placate advertisers and trackers is one of the main reasons. Combined with going to https, which defeats proxy caching[*] and needs extra computation, the experience is much slower.
[*]: This is why Google pushes and advocates https so much - don't be fooled into thinking they truly care about your privacy. Really, they make money on selling your private information and history. With proxy caching, they can't tell whether one person has viewed an element or a hundred, all behind the same proxy. The advertisers want to know that.
But part of it is code bloat too, with so many abstraction layers that every job takes orders of magnitude more work than needed.
There may well be some missed opportunities that I'm in no way qualified to comment on; but at least part of the "browser performance goes to hell when you have a zillion tabs open"/"it takes ages to restore a zillion tabs on restart" trouble seems likely to be connected to the fact that web pages have, somewhat awkwardly, evolved from being pretty much pure markup with a small sprinkling of javascript(which had the advantage, both for inexpensive background storage and quick restoration, of being nearly stateless, aside from any form fields that had been filled in; and could be stored or re-rendered from cached assets at your convenience); to being pretty much full applications, with lots of state all over the place; and often a variety of assumptions on the server side about what the client side is doing and vice versa. You can put such a page on ice; or dump it and re-render it from cached assets; but if you do, don't be surprised if you get dumped to a login screen or the page ignores most of what you've saved on its behalf and starts xmlhttp-request-ing anything that might have changed since it has been away.
If you feed them retro websites, or sites designed by people with classic taste, contemporary browsers are faster than a bat out of hell with rocket boosters. That just doesn't help you against modern websites; which are both bloated(typically with slow-as-hell 3rd party ad code, just to add injury to insult); and still somewhat awkwardly trying to move from a caching model mostly designed to keep pictures from being unnecessarily retransmitted to something suitable for letting full applications pick up where they left off.
And then end up getting modded down for making uninformed comments on account of not having read the featured article. Several sites admit that they can't tell tracking blocking (such as privacy.trackingprotection.enabled which uses Disconnect's list) from ad blocking, such as WIRED, The Atlantic, and the INQUIRER, and sites like Slashdot continue to link to stories on these sites.
HTTPS doesn't "defeat" a caching proxy near the client. It only requires users of said proxy to take the step of trusting the proxy's root certificate. The one thing it "defeats" is an intercepting proxy that tries to hide its existence from its users.
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.
Why are most websites so badly designed and so bloated they load slow?
Slashdot before 2.0 was screaming fast. Then they introduced all the JSON garbage that slowed it down. It's all about being pretty over functional.
Do not look at laser with remaining good eye.
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.
As long as web sites pack every possible space with bandwidth sucking animations. As long as refresh is used with wild abandon by incompetent web designers, browsers will appear slow.
Please do not read this sig. Thank you.
Use case example?
I'm searching for X programming topic. I enter it into Google.
Because I'm not a moron, I hold control-click and load all top-ten results in tabs. I then quickly compare-and-contrast them to make sure I getting the complete picture and not a heavily biased, tunnel-vision answer.
TADA.
Also, I open windows for separate "tasks" and tabs for related information to those tasks. (For example, one window is personal tabs like YouTube music and Gmail.) By time I end a work day, I've had over 180 tabs open. I use OneTab to store blocks of interesting tabs for later. Great for saving RAM on a netbook too.
And what happens if Chrome crashes, OR, I accidentally hit Control-Shift-Q (kill ALL CHROME TABS) instead of Control-Shift-W (kill all tabs in a single window.) Well, now I've got to RELOAD EVERYTHING holding control-shift-T until all the tabs I need come back.
I'm not arguing that Chrome should cache everything you do. But the idea that this use case never shows up is just plain silly. Maybe you should learn to multitask more before claiming other people never do.
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 you are missing is that even if the browser has the library cached, it still much reach out to the server to see if it has the latest version
Not if the version number is in the URL. Then the CDN can serve the library with an Expires: header with a value years in the future.
Just saying ...
http://saveie6.com/
What do you mean, 'slow'?
Have gnu, will travel.
And each one of them doing background work just like a regular application would, at least nowadays. Ask the idiots designing the pages and loading in a bunch of crap, not the browser writer.
If I were running 300 programs on my OS sucking up 100% of the CPU would you call me daft? Sure as shit you would.
Much of the recent blame should be placed on the new universality of using SSL/TLS for everything.
The problem is, negotiating a cold SSL/TLS handshake from scratch takes a certain amount of time... and there's very little you can do to speed it up with current standards. Adding certificate-revocation lookups compounds the problem and adds even more time. In the past, a site that "used SSL" might need to do one or two key exchanges for one or two different hosts. Now, a single page might require a dozen or more key exchanges... and some of those key exchanges might not even be known by the browser to be necessary until after it's done the first few (because some script delivered via https references some other asset via https on a different host).
SSL/TLS itself is generally a good thing... but the WAY it's currently being used was NEVER seen as a realistic use case 20 years ago when it was first implemented. Simply put, SSL/TLS key exchange and CRL doesn't scale well in their current form.
This is also part of the reason why it's so common to end up with "five bars of LTE signal strength, but no working data-connectivity" -- mobile apps are "chatty" to begin with, and many of them do a shit job of keeping https sessions alive between requests, so every single background https request requires yet another new handshaking and revocation-lookup. In areas where you have a cell site with limited backhaul connectivity and occasional surges in the number of users (say, a cell tower near a large state park serviced by only a T-1 line or two... on July 4th, when 60,000 people might descend on the park for a few hours), the endless key exchange traffic ITSELF can almost fully-saturate the tower's backhaul capacity.
There are several different phases involved in loading a web page. The first is how long it takes for the site to actually send the response to your request. If it takes 5 seconds to request index.php, there is not anything the browser can do to fix this. Caching and optimizing code will help, unfortunately most sites are build on a CMS (ie wordpress), and most designers / admin do not know how to optimize this properly. If this is slow it is usually either bad code, or trying to store entirely too much stuff in the database. Some, very poorly designed, sites will also make remote calls to external servers, this is painfully slow.
After the html is sent to the browser, the browser will start the rendering process. This involves loading all CSS and Javascript files referenced in the html. Old logic was to move the javascript to the footer to ensure they load after the main content is loaded. Unfortunately, with new browsers this does not matter. They will delay rendering of the content until all javascript is loaded on a site. This is to avoid information being moved around on the screen when files are finally loaded.
Hopefully, most designers will move their expensive javascript functions to a $(document).ready function but that only speeds the page display up after the javascript files have been loaded. Beyond that the best thing that designers can do for javascript heavy sites is defer the loading of their javascript. This allows the html to render before attempting to load javascript. Not all libraries support this, namely jquery, by default. But it will help speed up the time from the request to the time something is displayed on the screen.
With all of these methods, the time that it takes to completely load and render all content on the page will be about the same. But, from the users point of view, the page will appear to be loading faster.
I've complained and complained about how poor the performance of Firefox and Chrome and IE Javascript and CSS rendering engines to every board that they have!! I just can't get them to fix the speed with my desire to have 15 javascript frameworks and 38 custom stylesheets and have those automatically generate all the text in my site in a specific location so that I can resize the screen and have things bounce around and look just a little bit different in case someone with a mobile phone happens to come across my page and managed to get it loaded into the mobile browser before the render engine the browser to run out of memory and be killed by the operating system!!!!!
When you write up a nice block of text, browsers are super duper fast. Add in some images: still super fast. Add some basic javascript: cool beans, they can handle that. Some CSS to make things pretty? SURE! Oh, you want to lump in a generic framework of 800 functions, of which you really only need to use 10 of them, and an associated set of stylesheets that are then rewritten by parts of said JS Framework to draw out 13 little buttons? Well, that's going to work but your going to pay a price.
Web developers, do the internet a favor and test your pages on a browser running in a virtualmachine with 25% of 1 CPU and 512MB of memory, and force the network speed down to 2-4Mbps. And on that same VM, profile the page to see how it's render performance is handled. Then fix the page until it works there. Please, use all the JS files you want, but if your page takes more then 3 seconds to fully render, you're doing a disservice to the whole web.
And go away with any "upgrade your computer" BS. No one's using a C64 here. If you're page can render in 3 seconds on that VM, imagine what it will do on a modern PC.
Ok, I am very astonished by this question "Why are browsers so slow?" which since you're most likely a millenial you might as well re-phrase the question as "Why are browsers slow AF?"
No offense but you obviously have no idea what a slow browser really is. Try Netscape 6 or IE6 and let me know if you think Chrome is still slow. First of all, are you sure you can attribute all the slowness to the browser itself? Did you crack open the modern browser developer tools that we all have now (hint: Firebug and Chrome developer tools didn't used to exist until a few years ago) and look at the network tab or equivalent to make sure that the web server/REST service/whatever isn't taking a long time to serve back data? Better yet try profiling your own javascript code with console.log, console.time/console.timeEnd. Since you can use an identifier, you can even do it asynchronously, how fancy is that? I seriously doubt you've done any of these exercises because most modern browsers take javascript, compile it into native code and cache which is about the fastest you're going to get javascript to run. Microsoft completely rewrote it's rendering engine multiple times the latest of which is Edge. Firefox, Chrome and Safari have all had similar efforts. I've been a web developer for a number of years and I can tell you, the stuff we have now is lightning fast.
You try serving up a web page to Netscape Navigator using a cgi-bin perl script from an old version of Apache and let us know if you think modern tech is still slow.
It just appalls me. No matter how much better we make technology there is always a generation that comes along and tells us all of our effort are crap because they think everything needs to be bigger, better, faster. If you want to complain, you get engaged and make it what you think it ought to be. Until then you have no room to complain if you're just going to comment from the peanut gallery. Gah.
We'll make great pets
Why is that "Wrong"? Because your brain doesn't work that way? That's how I've always browsed and only recently did it become terrible.
It's "Wrong" in the sense that just because you can do something it doesn't mean it is a good idea. Your brain doesn't work that way either even if you think it does. People are demonstrably terrible at multitasking. That's why we can't talk on the phone and drive at the same time safely. You cannot possibly convince me that you are doing anything productive with most of those tabs. It's merely a form of hoarding. Opening that many tabs chews up a ton of memory and then you complain that things get slow? Of course it gets slow! What else would you expect?
Now it's your prerogative to run your browser any way you want but don't whine to me that it gets slow when you are doing something that very predictably should result in it running poorly. Furthermore don't pretend I'm stupid enough to believe that you are maximizing productivity by opening dozens of tabs you cannot possibly be actively working with.
If the endpoint's certificate doesn't check out, the proxy server refuses to issue its own certificate for that site.
That doesn't tell you what's wrong. And it always hides the real security details, showing the proxy server's security details instead.
And doesn't help if you need to access a site for which you have the CA but the proxy doesn't.
In practice, https pretty much defeats proxy caching. Which Google just loves.
I don't get why you think they're slow.
My Mosaic browser works ultra fast.
-- Tigger warning: This post may contain tiggers! --
One consistent performance problem I see across browsers is large tables take forever to render even with static column attributes. You can load an excel spreadsheet with tens of thousands of rows instantaneously.
The same data in a table pegs a core and consumes a GB or more of RAM with minutes or more delay. Often as the number of rows increase there is a huge corresponding drop-off in performance until it becomes practically unusable.
Otherwise I have no real issues with browser performance. Sure browsers like IE do the darndest things you've ever seen sometimes including getting so slow as to be unusable when display large ASCII text files. That's right.. not complex HTML but text rendered as TEXT.
Browsers are like everything else. The EE's give us incredible hardware and we go out of our way to waste it with lazy sloppy coding simply because it's cheaper not to care.
Browsers are the same way.. all kinds of hard work on fancy algorithms and optimizing performance ... obliterated by "developers" who think HTML/JavaScript/CSS are "too hard" and instead insist on piling on layer upon layer, framework upon framework, widget after widget, piecemeal XMLHttpRequest after XMLHttpRequest, fill site with social media bugs, cross site trackers, ads/malware, use third party bugs to get web stats because you are too lazy to install a stats package to analyze your own access logs. Some sites just enjoy selling out their customers to stalking firms who often cross sell-out customers to other stalking firms leading to hilarious trees of connections when accessing a single page. Yet others are completely oblivious to what is going on behind the scenes.
Web sites written by people who care about wasting their users time load instantaneously. It's amazing. Never really had issues with browsers themselves not being responsive divorced from the bullshit occurring within them. I'm not really sure how what is being described by TFA is even possible given so much runs in separate process/memory space these days.
I think I found your problem:
Which takes ages if you have a hundred of tabs.
I can't imagine my browser being remotely functional if I had hundreds of tabs open.
Virtual desktops.
I generally have 6 to 8 virtual desktops, each dedicated to a particular type of task or project.
Within each desktop I typically have a browser, 2 or 3 if the browsers are showing fundamentally different things.
Within each browser I'll have anywhere from 1 to 6 (rarely more) tabs on different slants on the same topic.
So if I'm working on AWS that would be in a virtual desktop. I might have one browser for dynamic stuff (like their console) and one for documentation. The documentation browser may well have 6 tabs. When I'm not using the browser I icon-ify it.
Trivial, at least for me, to keep things sorted that way. I know if I'm on desktop X then I'll have a browser dedicated to X, if I don't see it then it's been icon-ified.
I use the Tree Style Tab extension in Firefox. Not only I get the tabs on the left side of the screen with easily readable titles, the child tabs are found in the tree creating simple organization automatically. Not sure if I would give up adblock or the tree style tabs if I had to choose
It is what it is.
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.........