72
submitted 9 months ago* (last edited 9 months ago) by illectrility@lemmy.world to c/asklemmy@lemmy.ml

Why are so many mobile browsers at least 100, if not 200 megabytes in size? Even Firefox Focus which is supposed to be small and, you know, focussed is 85MB big.

The smallest browser I could find was the /e/ Foundation's built-in browser for /e/OS. It's 12MB.

It's kind of between Firefox and Focus in terms of features so why are all other browsers so big? Is there a small version of Firefox for Android?

Edit: I just looked up the /e/ Browser repo on their GitLab and the browser appears to be bigger than the 12MB displayed in App Info. It's about 70MB, so pretty comparable to the other browsers. I was so confused by the size difference but that's cleared up now.

top 50 comments
sorted by: hot top controversial new old
[-] rockSlayer@lemmy.world 104 points 9 months ago* (last edited 9 months ago)

Browsers are highly complex pieces of software. I had the opportunity to talk about browser engines with a hardware engineer for the chrome browser at GDC a year ago. Browser engines have to have more security than your operating system, while also interpreting DNS calls, rendering html/css, and interpreting JavaScript.

A basic html renderer would be small, like maybe a couple megabytes. But it would have absolutely no security. On the Internet.

[-] fubo@lemmy.world 40 points 9 months ago

interpreting JavaScript

Compiling, these days. The JS runtime is a beast.

[-] rockSlayer@lemmy.world 14 points 9 months ago

Fair. Webassembly is fast for a reason

[-] intensely_human@lemm.ee 3 points 9 months ago

Because it eliminates unnecessaryspaces?

[-] rockSlayer@lemmy.world 1 points 9 months ago

Kinda. The other person was right about JS basically getting compiled. Webassembly is like an intermediary language that executes at a similar speed to flash, because it's more directly translatable to the runtime. Webassembly isn't supposed to fill the gaps left by flash, but I think it's a great option to get similar web apps

[-] mojo@lemm.ee 5 points 9 months ago

Web browsers are practically as complex as operating systems tbh

[-] KISSmyOS@lemmy.world 1 points 9 months ago

On my private laptop, the operating system's only job is launching the web browser.

[-] illectrility@lemmy.world 3 points 9 months ago

I am aware of the complexity of a modern browser. Still, 80+ megabytes for a simple browser like Focus seems excessive. Especially when the Bromite-based /e/OS browser can provide more functionality for an eighth of the size

[-] rockSlayer@lemmy.world 22 points 9 months ago

When it comes to software, complexity usually means one of 2 things: time complexity or space complexity. They have an inverse relationship, so if you want something fast you need more memory, and vice versa. In regards to browsers, that means either waiting forever to execute each op or using large amounts of storage/memory.

[-] illectrility@lemmy.world 3 points 9 months ago* (last edited 9 months ago)

Yeah, of course a lot is cached and stored in user data ~~but I don't get why the app itself has to be so big. It's not significantly faster.~~

Edit: Never mind all that, I edited the post, the app size wasn't correctly shown.

[-] rockSlayer@lemmy.world 13 points 9 months ago* (last edited 9 months ago)

Caching is separate. Honestly, I don't know how to explain it to you without giving you a college level explanation of time complexity.

Think about the most basic way to sort a list of arbitrary size; comparing the first item to the second item, swapping if the second item is smaller, and then repeating until no more swaps occur. This has a time complexity of O(n^2), so on a list of n size, it would be extremely cheap on memory (O(1)) but will take a very long time if n is large.

There's another sorting algorithm called quicksort that is much faster (how it works isn't very important atm), with a time complexity of O(nlog n). This is far faster than the other method of sorting, but it comes at the cost of needing a lot more memory to execute the algorithm, O(log n) of space.

If you scale this simple process to a multithreaded piece of software executing thousands of algorithms per second, like a browser, the size of n scales to the rest of the app. Browsers are generally written in C++, which requires memory to be preallocated. The size of the app includes this memory requirement, as well as the executable.

[-] illectrility@lemmy.world 4 points 9 months ago

I understand, my confusion was caused by the misleading app size shown in App Info. It's actually like 70MB so my question is dumb. I'm sorry for wasting your time

[-] rockSlayer@lemmy.world 7 points 9 months ago

it's not dumb, and you didn't waste my time! I love teaching computer science to people. Honestly, this was kinda fun. I haven't consciously thought about these concepts in about 6 years, so it was a good refresher for me too lol

[-] illectrility@lemmy.world 6 points 9 months ago

I'm glad to hear that, I had fun, too. Thank you for your time and have an amazing day, kind stranger

[-] intensely_human@lemm.ee 2 points 9 months ago

One time I had a database migration running on a database of about 50gb. After eight hours it was still going.

My client had the suggestion to try bumping up the memory on the server. So (in digital ocean) I scaled a server from 8gb memory to 64gb, and ran the same migration. It took about twenty seconds. Then just scaled the server back down.

It’s kinda amazing just how significant efficiency differences can be between strategies. In most realms a 10% improvement is huge. In software a 1000000000% improvement can result from choosing a new strategy.

[-] intensely_human@lemm.ee 3 points 9 months ago

Don’t forget developmental complexity. The real limited resource is developer brain power which is the primary (and legit) reason for most failures to optimize algorithms.

Sometimes the most optimized solution requires a developer with enormous working memory, who can write code nobody else on the team can follow.

I worked on an app as a subcontractor once and this guy had functions generating functions to generate functions. It worked, and it was parsimonious in a way. Like he was optimizing for the bundle size and it was pretty impressive, but I simply couldn’t get anything done because the way it was structured required me to hold like 12 chunks of info in my 7-chunk working memory.

I eventually got some progress but only after I had transferred a significant amount of the code into my long-term memory. (As an autistic my working memory was shit growing up so I learned to use my long term procedural memory as a stand-in for short term memory. Problem is it’s a brittle strategy, doesn’t respond to changes well, and is highly sensitive to what kinds of patterns are used).

[-] huggingstars@programming.dev 32 points 9 months ago

All complete browsers are big. The small ones typically don't have their own engine built-in.

iOS browsers all use Safari's WebKit as their engine, so they'll probably be smaller than their Android counterparts.

[-] intensely_human@lemm.ee 1 points 9 months ago

So webkit is used as a system library? Not bundled in?

[-] jamiehs@lemmy.ml 1 points 9 months ago

No it’s worse than that. All iOS browsers need to use a Safari (WebKit) web view as far as I understand. So any browser on iOS is literally just barebones Safari with a different UI and possibly a different user agent.

In fact, until recently this was even worse as Safari on iOS enjoyed some accelerations/optimizations that the web views did not get to leverage; so for a while all iOS browsers were not only Safari, but they were slower Safari.

[-] Never_Sm1le@lemdro.id 19 points 9 months ago

I don't think that /e/ even a "browser", more like "webview viewer"

load more comments (6 replies)
[-] the_q@lemmy.world 18 points 9 months ago

100mb isn't that big these days, bud.

[-] ekky43@lemmy.dbzer0.com 26 points 9 months ago* (last edited 9 months ago)

But it should be.

Better technology and more storage should never excuse a lack of optimization.

I'm not up to speed on the optimization levels of mobile Web browsers, but these days you rarely see properly optimized consumer software. Games and websites tend to be the worst offenders, and many mobile apps appear 10x the size you would expect them to be.

[-] illectrility@lemmy.world 4 points 9 months ago

Imagine the utopia we would live in if every website was as beautiful as this https://perfectmotherfuckingwebsite.com/

[-] zero_iq@lemm.ee 8 points 9 months ago

True, but I'd still like to see the explanation for why a mouse driver needs to be 300MB...!

[-] the_q@lemmy.world 3 points 9 months ago
[-] zero_iq@lemm.ee 6 points 9 months ago

Ah, of course! And it does have extra buttons too. Remarkable they squeezed all that advanced engineering in under half a gigabyte, tbh. I clearly didn't think it through!

[-] xmunk@sh.itjust.works 16 points 9 months ago

Dude, you should see webpages... if it's built using react a website can easily clock in at half a gig.

[-] PM_ME_YOUR_SNDCLOUD@lemmy.world 11 points 9 months ago

You’re not wrong but it feels disingenuous to say this. The entire repo with all of its dependencies checked out for a large website can easily clock at half a gig but there’s no popular website now that’s asking any users to download half a gig worth of stuff before they can use it.

There ARE websites where, if you keep them open long enough, they’ll constantly pull more and more data (usually for ads) but even that is measured more so in tens of megabytes.

And none of this is to say that websites haven’t gotten too big, just that comparing a downloaded app’s size to the size of a website’s unbuilt unbundled source with all of its dependencies is an unfair comparison.

load more comments (1 replies)
[-] ignism@lemmy.world 2 points 9 months ago

I am not sure you know what you are talking about. How is react the factor here of making it 500 MB?

[-] jamiehs@lemmy.ml 1 points 9 months ago

People like to hate on React these days… don’t read into it too much. As always, it’s the person wielding the tool, not the tool’s fault.

[-] Fleppensteijn@feddit.nl 15 points 9 months ago

Browsers will grow with cache and settings etc.

I'm more curious about mobile apps in general. I had to install Microsoft Authenticator to log in to my work account and it costs 165 MB. It sucks because disk space is so limited

[-] illectrility@lemmy.world 4 points 9 months ago

165??? That's insane, you may be better off with KeePassDX. It combines password managing and TOTP

[-] Fleppensteijn@feddit.nl 1 points 9 months ago

Nah, I had my own authenticator (Aegis) until MS decided you can only use theirs

[-] illectrility@lemmy.world 2 points 9 months ago

Wait what? They force you to use their authenticator? How, when, what?

[-] Fleppensteijn@feddit.nl 3 points 9 months ago

It started nagging I need to switch to Microsoft's authenticator but it was skippable for a while until it wasn't 🤷‍♂️. They apparently use their own method that other authenticators can't imitate.

[-] Pantherina@feddit.de 9 points 9 months ago

There are many browsers that just use Chromium Webview and add their 2 cents. Some Chromium-based ones dont, like Brave, Cromite, etc, as they mod the webengine themselves.

Firefox basee Browsers all ship their engine included, as geckoview is not a webview poorly.

[-] Knusper@feddit.de 8 points 9 months ago

Is there a small version of Firefox for Android?

There was Firefox Lite, but it was really Chromium under the hood (using Android's built-in WebView, to keep that download size small). It was discontinued in 2021.

https://support.mozilla.org/kb/get-started-firefox-lite

[-] the_lone_wolf@lemmy.ml 7 points 9 months ago

4MB jquarks browser with built-in adblocker

[-] sim642@lemm.ee 4 points 9 months ago

Doesn't it just rely on the Android built-in WebView?

[-] the_lone_wolf@lemmy.ml 1 points 9 months ago

Yes and i don't see any problems in that, it will be more secure bcz system webview automatically gets updated to mitigate vulnerability.

[-] sim642@lemm.ee 1 points 9 months ago

It's just an unfair comparison. The Firefox app includes a whole browser engine while this one just uses an engine built into Android itself.

[-] Granixo@feddit.cl 7 points 9 months ago

Try out Via, it weights less than a MB.

[-] shiiiiiiiiiiiiiiiiiiiiiiiiiiiiiit@sh.itjust.works 4 points 9 months ago* (last edited 9 months ago)

Amazing, this looks like it's a lightweight wrapper around Android System Webview. It reminds me of the abandoned Naked Browser. I'll try it out.

Edit: My password manager says no password fields detected. Anyone else got Via working with a password manager?

[-] illectrility@lemmy.world 3 points 9 months ago

Thanks for the tip, I like the UI

[-] mexicancartel@lemmy.dbzer0.com 2 points 9 months ago

Browsers are big. Some just loads webpage and renders with system webview so they don't bundle their own browser engine

load more comments
view more: next ›
this post was submitted on 28 Oct 2023
72 points (93.9% liked)

Asklemmy

43027 readers
1460 users here now

A loosely moderated place to ask open-ended questions

Search asklemmy 🔍

If your post meets the following criteria, it's welcome here!

  1. Open-ended question
  2. Not offensive: at this point, we do not have the bandwidth to moderate overtly political discussions. Assume best intent and be excellent to each other.
  3. Not regarding using or support for Lemmy: context, see the list of support communities and tools for finding communities below
  4. Not ad nauseam inducing: please make sure it is a question that would be new to most members
  5. An actual topic of discussion

Looking for support?

Looking for a community?

~Icon~ ~by~ ~@Double_A@discuss.tchncs.de~

founded 5 years ago
MODERATORS