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?
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.
Now that they're owned by the Chinese, fuck Opera.
Try Brave. It's very very fast, and blocks all sorts of crap. It's based on the Chromium browser
https://www.brave.com/
Life is not for the lazy.
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.
It's not just ads; a lot of websites pull in JS helper scripts from other sources (instead of hosting local copies of their own). And those sources do not always have the best performance.
If construction was anything like programming, an incorrectly fitted lock would bring down the entire building...
Using a good, fast third party source
LOL
I see what you did there.
Also, I just clicked on AdBlock Plus --> Open Blockable Items. There are 31 scripts on this page.
31 MOTHERFUCKING SCRIPTS ON ONE PAGE!!! You people are insane.
The web is unusable. When loading any website containing content intending to be read (news article, blog post, &c.), I poise my mouse over the "reader mode" button and stab it the very instant it appears.
I will not even try to read content on pages with moving shit in the side-bars, dropping-down menu bars, random crap that unpredictably overrides scrolling, popups sliding up and over and all around the fucking place, sometimes minutes after the page finished loading because they know that's how they can irritate you into looking at it.
If the reader mode button doesn't show up, I don't even bother trying to use the page. I just close it.
Stop instructing your browser to block things. You don't need an add-on to define network connections. Start telling your network stack where to not find them:
HOSTS-level blocking
http://winhelp2002.mvps.org/ho...
And if that's not enough, look into PAC files. You won't be disappointed.
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).
That should have a "less than" sign in front of the "5 seconds"
--
BMO
OK, I just benchmarked 1000 forks in C++ on the lowest-end desktop Sandy Bridge Core i3-2120T running at a reduced frequency of 1.6 GHz. I got 89,130: a whopping 89.13 microseconds per fork.
#include <chrono>
#include <iostream>
#include <unistd.h>
#define N 1000
int main() // std::cout << pid << '\n';
{
auto start = std::chrono::system_clock::now();
for (int i = 0; i < N; ++i)
{
int pid;
if (!(pid = fork())) {
exit(0);
}
}
auto stop = std::chrono::system_clock::now();
auto elapsed = std::chrono::duration_cast<std::chrono::microseconds>(stop - start);
std::cout << elapsed.count() << " microseconds for " << N << " forks\n";
return 0;
}
I disagree, when reopening the entire browser it is a perfectly legitimate use case to go back exactly where you were. Opera has long had the feature to tell the browser to automatically reload a page every X seconds, Minutes, or hours. So if you're use case is you need to constantly need updates on the current thing being hosted, Opera already does what you want. Now, perhaps there is a misunderstanding of what the summary is talking about in terms of reopening a tab. This is only occurs when you reopen a group of saved tabs (generally from the last time you closed it). This does not occur if you simply type an address, click a bookmark, or any other "normal" method of opening a link.
Looking at RequestPolicy this page redirects to 41 other sites.
41 MOTHERFUCKING REDIRECTS ON ONE PAGE!!! You people are insane.
"A person is smart. People are dumb, panicky dangerous animals and you know it." - K
Forking a non-trivial program may incur more practical lag than forking a trivial program, as more copy-on-write pages have to get duplicated once the forked process starts running.
You're wrong.
Actually, you are.
Even if they've already got the library disk-cached, it's actually slower to access the disk cache, and check the cache age, and verify that there isn't a newer library version (did you know the browser often goes round-trip just to check?) than it does to simply serve the library in-line.
It depends on cache control headers originally sent by the CDN, but this is usually completely false. Google can set an Expires header a year in the future and the browser will NOT do a round trip to check. That only happens if the cache control is set to must-revalidate, and few good script CDNs will do that. Aside from that, disk will always be faster than network.
Benchmark it yourself. Serve 100KB of javascript in-line, in the middle of your html file. Compare that to a separate src= js file.
Modern browsers handle inline script very differently than those pulled in via an external file, so that confounds things somewhat. But even then, the only time it matters is the first time the user goes to any page with the jQuery (or whatever) that gets loaded from Google's CDN. After that it doesn't have to transfer it until the cache expires, so it's always going to be faster than putting it inline. Besides, putting libraries inline is 100% wrong, even if you host it yourself, because it makes client caching impossible.
"What do you despise? By this are you truly known." --Princess Irulan, Manual of Muad'Dib
/)
Ghostery
My first e-mail address had a comma in it, and token rings sucked for a lot of reasons. That's how long I've been developing web-sites.
But I didn't say I've been building web-site for three decades. I said, quite obviously, that I've been serving pages to clients for three decades.
You may be way too young to understand the difference between real-world practical and academic history, but the world wide web was not the start of the internet, the internet was not the start of networking, and networking was not the start of serving pages to clients.
Caching's been around for a very long time. If you want to learn about the benefits of caching, and the pitfalls, you want to look at archive caches, not transmission caches. When access involves an elevator, or a truck, you quickly learn what does and does not make sense.
Here's a perspective for you. When accessing a cache from a warehouse two miles away involves a truck, you get to consider the effects of rush hour traffic. So when your third-party server caches your javascript file, you get to consider that it isn't geographically in the same place as your primary server, meaning that not only does your client need to hit "another" server, with another connection, another keep-alive, and another set of caches, but it also needs to get there, through an ISP channel full of traffic. You've just doubled the amount of traffic globally. You can't ever bet on it being fast. You can only hope.
So, of course, you have a basement cache of your warehouse cache -- i.e. the disk cache. Elevators don't have traffic; or so you say. But the warehouse is full -- always, because that's what a warehouse is. So you get to search stacks and shelves and indexes. You get to have organizational training, and inventory days. Welcome to the magic of disk thrashing. The file table is incredibly slow in terms of file handles. Welcome to WAD files. Defragging is the inventory day, by the way.
So now you've got your reliable cache, that's only reliable under minimal load. Perfect. But some things get accessed often. So you keep a copy upstairs in the filing cabinet. But the filing cabinet is small. So you shuttle different cabinets up and down per day. Today you need the green cabinet. Tomorrow, the red. And life is good. Welcome to swap files -- memory to disk and back.
Now you've got employees shuttling cabinets, with dollies, and elevators, and warehouses, and trucks, and traffic. And here's the kicker. You haven't eaten yet! You've got a dozen staff, countless duplicate copies of files, trucks, buildings, elevators, desks. But you haven't done a lick of revenue-generating work yet.
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.