21
Condor
3y

Chrome, Firefox, and yes even you Opera, Falkon, Midori and Luakit. We need to talk, and all readers should grab a seat and prepare for some reality checks when their favorite web browsers are in this list.

I've tried literally all of them, in search for a lightweight (read: not ridiculously bloated) web browser. None of them fit the bill.

Yes Midori, you get a couple of bonus points for being the most lightweight. Luakit however.. as much as I like vim in my terminal, I do not want it in a graphical application. Not to mention that just like all the others you just use webkit2gtk, and therefore are just as bloated as all the others. Lightweight my ass! But programmable with Lua, woo! Not like Selenium, Chrome headless, ... does that for any browser. And that's it for the unique features as far as I'm concerned. One is slow, single-threaded and lightweight-ish (Midori) and another has vim keybindings in an application that shouldn't (Luakit).

Pretty much all of them use webkit2gtk as their engine, and pretty much all of them launch a separate process for each tab. People say this is more secure, but I have serious doubts about that. You're still running all these processes as the same user, and they all have full access to the X server they run under (this is also a criticism against user separation on a single X session in general). The only thing it protects against is a website crashing the browser, where only that tab and its process would go down. Which.. you know.. should a webpage even be able to do that?

But what annoys me the most is the sheer amount of memory that all of these take. With all due respect all of you browsers, I am not quite prepared to give 8 fucking gigabytes - half the memory in this whole box! - just for a dozen or so tabs. I shouldn't have to move my web browser to another lesser used 16GB box, just to prevent this one from going into fucking swap from a dozen tabs. And before someone has a go at the add-ons, there's 4 installed and that's it. None of them are even close to this complete and utter memory clusterfuck. It's the process separation. Each process consumes half a GB of memory, and there's around a dozen of them in a usual browsing session. THAT is the real problem. And I want to get rid of it.

Browsers are at their pinnacle of fucked up in my opinion, literally to the point where I'm seriously considering elinks. Being a sysadmin, I already live my daily life in terminals anyway. As such I also do have resources. But because of that I also associate every process with its cost to run it, in terms of resources required. Web browsers are easily at the top of the list.

I want to put 8GB into perspective. You can store nearly 2 entire DVD movies in that memory. However media players used to play them (such as SMPlayer) obviously don't do that. They use 60-80MB on average to play the whole movie. They also require far less processing power than YouTube in a web browser does, even when you download that exact same video with youtube-dl (either streamed within the media player or externally). That is what an application should be.

Let's talk a bit about these "complicated" websites as well. I hate to break it to you framework web devs, but you're a dime a dozen. The competition is high between web devs for that exact reason. And websites are not complicated. The document itself is plain old HTML, yes even if your framework converts to it in the background. That's the skeleton of your document, where I would draw a parallel with documents in office suites that are more or less written in XML. CSS.. oh yes, markup. Embolden that shit, yes please! And JavaScript.. oh yes, that pile of shit that's been designed in half a day, and has a framework called fucking isEven (which does exactly what it says on the tin, modulo 2 be damned). Fancy some macros in your text editor? Yes, same shit, different pile.

Imagine your text editor being as bloated as a web browser. Imagine it being prone to crashing tabs like a web browser. Imagine it being so ridiculously slow to get anything done in your productivity suite. But it's just the usual with web browsers, isn't it? Maybe Gopher wasn't such a bad idea after all... Oh and give me another update where I have to restart the browser when I commit the heinous act of opening another tab, just because you had to update your fucking CA certs again. Yes please!

Comments
  • 4
  • 2
    @korrat I didn't try it yet but I installed it and it looks pretty interesting! It unfortunately seems that even they also use webkit2gtk. However it's only one of those processes due to the browser being single tabbed. It still uses 250M which is more than I'd expect from a web browser but it's much better than 8GB of course. Thanks for mentioning this! :)
  • 7
    Unfortunately webbrowsers are complicated as fuck.
    A reasonable useful browser nowadays has to do (just to name a few things):
    - Video/Audio en-/decoding and streaming (both directions)
    - Game controller user mode drivers (yup)
    - 3D rendering
    - Support a dozens of image formats
    - Render and manipulate webpages several megabytes big (with thousands and thousands of JavaScript interfaces, CSS specialities and so on)
    - Interpret JavaScript and Web assembly byte code (ideally with a JIT compiler)

    To hope this (and more) can be done in a "lightweight" manner is just silly.

    About the multiple processes: Firefox had a single process for everything just a few years back. If JavaScript in a single tab made it "hang" the whole browser did. We can hardly prevent that w/o removing JavaScript...

    Oh and the tabs _are_ properly isolated and locked at least on Chrome (blink engine). They can only do one thing: Calculate, access itself and do IPC. Not more not less, not even access X11.
  • 2
    @sbiewald I understand that browsers have to do a lot of work to be useful. That is however a choice on the browser vendors' part, and their responsibility to implement it well if they do. As far as the silliness goes, I have opened another tmux window next to my usual one, and opened elinks in its single pane. At 4 tabs open, it consumes 17MB of memory. And all of the stuff I need to see on pages I visit is there. I was even able to log in to my Gitea instance from it, since it does not require JavaScript (a form submission in a POST request is all it needs). I do believe it is an attainable goal.
  • 3
    @Condor That's not the choice of browser vendors, its what the users demand.
  • 1
    @theuser I have disregarded user requests enough times to not be bothered by that. My projects, my rules. Browser vendors can do the same thing (and with the ridiculousness of some web devs' requests, perhaps they should).

    For example, I can count the amount of websites that I'd reasonably allow to play media content on one hand (YouTube yes, a random news site no). I can count the web apps that use WASM as far as I'm aware on one hand (Google Earth and such). It is also one of the few websites I know of that use 3D rendering. I do not think it is reasonable to do gaming in a web browser, the usermode game controller drivers are lost on me (those should be in the kernel anyway).

    My browsing habits usually include doing research, reading articles, tutorials and such. My social media is not part of it, these run in dedicated applications. If the above are what make webkit2gtk based browsers and their processes so bloated, then perhaps it should be optional.
  • 0
    The standard includes 3D transforms, audio and video processing, two separate languages and an interface between them, a wide array of interfaces soon including an asynchronous filesystem API.
    A tree with multiple parenthood using the shadow DOM is the basis for rendering, styled by the most complex styling parameter system to ever exist.
    Oh, and a stupid amount of optimizations are pretty much necessary even though they aren't in the standard because Javascript doesn't allow the programmer to express constraints so the browser has to figure them out.
    I understand your frustration but this isn't on the browsers.
  • 6
    @Condor Unfortunately there's a competition, and no browser can refuse to implement a feature without risking falling behind.
  • 2
    @Condor What @homo-lorens means is the key point. It is also the reason we only have thre e relevant browser manufacturers left (Google making Chrome/Blink, Apple with Safari/WebKit and Mozilla with Firefox/Gecko).
    Safari is - besides iOS and iPadOS - closely dead (ignoring the small browsers using WebKit with neglectible market share) - there are no other relevant engines. Microsoft gave up, and Firefox is in steady decline, with one reason being they can't keep up with Google's new standards.

    By the way, gaming in Webbrowsers recently increased in popularity with Google's Stadia and Geforce something...

    And I disagree with you in that drivers should reside in the kernel 😉 (but they still should be provided by the OS if possible).
  • 3
    @theuser I hate arguments like this. I have never, ever heard a user wanting fucktons of JavaScript so a button can flash. You can make most websites look and work perfectly fine with HTML + CSS and some templating language to fill in data. Maaaaaaybe out in some JS to make the site a bit more usable but that's it.

    No one, and I mean no one, has ever asked for the megabyte size libraries that change a button's size on hover (that doesn't make sense since most users access websites from their fucking phones). It is all because "ApPlE aNd GoOgLE lOoK nIcE sO wE mUsT tOo".

    Fuck the average designer that just follows whatever Google and Apple say is the new cool and fuck lazy developers that can't be arsed to think and just import the sun's mass in node modules to change a color at runtime. Fuck I hate web development.
  • 0
    @Nanos Not really, I run all my systems' rootfs on SSD so fragmentation isn't an issue. However, browsers do flush a lot of data to disk, very often (several times a second). This is mostly for caching and things like that. It is *very* noticeable on systems with CF card storage (so flash modded IDE systems), and I reckon on spinning drives as well... On an SSD the writes are still there (wearing out the SSD), but it's less of a usability issue.
  • 1
    I'm curious about what websites you were using that consumed so much memory. I recently compared Reddit with old.reddit, libredd.it, and teddit.net and the difference is staggering.

    That new design is both awful and bloated as fuck.
  • 1
    @Jilano Hard to remember since I already closed that session.. half a dozen or so tabs about a travel I'm planning (Google Maps, Booking, travel blogs etc) and some Wikipedia articles after I got interested in the country's internals (political issues etc). Except Google Maps, all of them had JavaScript disabled or temporarily enabled for their own domain (and possibly a CDN).
  • 2
    @Condor Understandable, no worries

    Do tell if you ever find something better!

    PS: I remember a browser called QuteBrowser. While it was advertised for its full Vim control by default, I wonder how it'd do against the ones you mentioned

    PS2: Have you tried on a Windows machine just for fun? I don't think I've ever gone above 2/3GB with 20+ tabs on my work machine
  • 1
    @Jilano Haven't tried Qute yet, will try it out asap! Would be very interesting if it uses something other than Webkit2Gtk. I've "written" a web browser as part of my other rant as well. It's fairly barebones (takes URL as an argument only) and many UI features such as search are missing. However the Webkit2Gtk engine does make the rendering part just like any other web browser (because at the engine level it pretty much is).

    I don't use Windows other than Windows 7 and try to avoid browsers there (given Win7's current unsupported nature). But yeah both web browsers (usually Opera) and the system itself are highly adaptive to the memory configuration they are working in. I've got some VM's running off 2GB RAM, and it runs flawlessly. Granted the amount of tabs is usually very low and sessions are short, that's likely also relevant.
  • 1
    The chance to restrict browser weight is over. It is too late for that now as everyone is using the browser as a second OS already.

    The war is lost. The attack surface is OS-sized and there will always be 0days left to find.
    The only hope now is to translate the browser and all libs they use into some memory safe language so the next big worm will just crash all browsers instead of creating a botnet consisting of the entire Internet...
  • 0
    Well I can see it being a problem in virtualized environments.
    Some of our clients were running virtualization and our app just crashes there (Not enough RAM, we need for some workloads up to 2GB per TAB).
    But from consumer perspective, all chromium-based browsers run pretty fast. When I look at my mother using chrome, she has like 5 tabs opened. (k I put 16 GB ram in her PC just in case).
    Even on my working PC with “only” 16GB ram and 3 to 5 instances of Visual studio I don’t have performance issues.
    If there is ram available, why not use it ? (Yes chrome can go a bit overboard sometimes).
    For 1 process per tab, I don’t care about security. I just don’t want spotify / youtube to freeze when I’m testing my own app with some BS data set taking up to 3.2 GB of ram
  • 1
    My two cents on the process per tab:
    Once, the OS can schedule better on different cores than the browser can via threads (I reckon, not 100%sure though)

    Second: security, each different processes have different address spaces (hence increased ram usage) which makes timing attacks (read: spectre) a lot harder than inside a single process.

    Also unused ram is wasted ram.
  • 6
    > Imagine your text editor being as bloated as a web browser. Imagine it being prone to crashing tabs like a web browser. Imagine it being so ridiculously slow to get anything done in your productivity suite.

    VS Code people:
  • 1
    @Nanos Mate, that wasn't a web browser tab, that was a memory leak
  • 1
    @dder Yes, multithreading does allow the OS to schedule processes on different cores, and even to move processes between them. A distinction must be made between process threads and processor threads though. Processor threads (i.e. hyperthreading) is using the same core twice. Perhaps like using a thread more than your total in make's job count. Process threads on the other hand are lightweight processes, they get their own PID and such, but are apparently faster to initialize and tear down than a full process fork.

    Unused RAM is wasted RAM also needs context. If you say that to an Arch/Gentoo/etc user who just spent a week on setting up a WM and says "this uses only 200MB" then yes. What's the point if you won't run anything else on it? But to excuse the behavior of wasteful programs is not. We sysadmins can and do fill up our memory easily. It's not a matter of total memory in the system. It's what the combined workload will take, how many tasks I can let this server execute.
  • 0
    As far as multithreading goes, I think it should be a fundamental design element in your code, like your functions would be. If you have a block of code that can run on its own independent of the rest of the code, then by all means isolate it so that it's easy to assign it its own thread of execution. However, it appears that most web browsers just run a webkit2gtk process for each tab, and that's it. Perhaps that's why it's so easy to snap them out of their existing window and into a new one... It's already its own process after all.
  • 0
    Side note: it seems that even a single devRant tab consumes no less than 1GB of memory. This is absolutely ridiculous. Whatever UI elements on top of the engine that Firefox needs half a GB in its main process for is beyond me. How the Web Content processes can consume 300+MB is beyond me, devRant isn't heavyweight as a website at all. And the Privileged Content process is literally consuming as much as my OS kernels with all their drivers would consume, 5 times over.
Add Comment