Live data from Hacker News

Ask HN: One tab on Chrome takes about 100MB memory, why?

news.ycombinator.com

131–140 of 210 posts

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#131

Because it is 2018 and people have forgotten how to static HTML. All that lovely rendering code in your browser goes unused as people rewrite it in Javascript, badly; or even in C++ and then compile to web assembly, that’s all the rage now, because why stick with one layer of abstraction when you can involve three? Oh, and of course everyone rolls their own, so that website with the dancing pigs not only has its own…

I don't know, WebAssembly compiles to very small blobs (if done right), you can get a lot of functionality out of a few KBytes. Imagine if we could throw out all the high-level crap from the browser core (WebAudio's node graph, all the video and audio codecs, HTML/CSS/JS engines with all legacy features they need to support, etc etc... and replace that with wasm modules which are only loaded on demand. Then browsers would become much smaller, and web pages would only need space for the features they actually use.

Of course this wouldn't be a 'web browser' in the traditional sense, but a (reasonably) safe runtime platform for untrusted code without a central 'Big Brother' who decides what is good or bad for users.

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#133

Because it is 2018 and people have forgotten how to static HTML. All that lovely rendering code in your browser goes unused as people rewrite it in Javascript, badly; or even in C++ and then compile to web assembly, that’s all the rage now, because why stick with one layer of abstraction when you can involve three? Oh, and of course everyone rolls their own, so that website with the dancing pigs not only has its own…

I don't know, WebAssembly compiles to very small blobs (if done right), you can get a lot of functionality out of a few KBytes. Imagine if we could throw out all the high-level crap from the browser core (WebAudio's node graph, all the video and audio codecs, HTML/CSS/JS engines with all legacy features they need to support, etc etc... and replace that with wasm modules which are only loaded on demand. Then browsers…

I’ve not seen much WebAssembly “done right” to date; IME it is most often employed to spew gargantuan legacy C++ applications verbatim into the browser to avoid having to understand which parts are actually desired, whether and how they can be unpicked from the rest, and whether they are trivial enough to actually just reimplement in Javascript or otherwise as standalone modules. This does not bode well for the utopia of small clean blobs you propose, though I do agree it would be nice if it came to pass.

I am perhaps too pessimistic here; wasm is young and has still to develop much of its own culture. I shall watch that space with interest.

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#134
post #87

To my overly long TODO-list I added a web browser project. I would like to see something akin to Links [0] or Lynx [1] with a bit of Dillo [2], but also for mobile. Features & non-features: - it would generally work like the reader mode (no other modes) trying to place navigation links in a predictable place - user can easily select text size and color schemes - night mode (Android does not have one) - because of it'…

I've been kicking around some related ideas:

https://www.reddit.com/r/dredmorbius/comments/6bgowu/what_if...

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#136

Earlier quoted context omitted.

I don't know, WebAssembly compiles to very small blobs (if done right), you can get a lot of functionality out of a few KBytes. Imagine if we could throw out all the high-level crap from the browser core (WebAudio's node graph, all the video and audio codecs, HTML/CSS/JS engines with all legacy features they need to support, etc etc... and replace that with wasm modules which are only loaded on demand. Then browsers…

I’ve not seen much WebAssembly “done right” to date; IME it is most often employed to spew gargantuan legacy C++ applications verbatim into the browser to avoid having to understand which parts are actually desired, whether and how they can be unpicked from the rest, and whether they are trivial enough to actually just reimplement in Javascript or otherwise as standalone modules. This does not bode well for the utopi…

Don't worry. If we've managed to blow our binaries up to 100s of MB, we can do it with our websites, too!

(Seriously. Chromium is 124MB. How does anyone think web dev will go differently?)

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#137
post #14

Earlier quoted context omitted.

1 is entirely possible. Opera 12.x takes ~3-10MB per TAB (+the weight of the media used on the page). There is zero latency, opening new/switching tabs is instantaneous. Google devs use 16-32 core machines, often with hundreds of gigabytes ram. Why would they bother optimizing?

this is supposed to be exaggerated but who the fuck uses a 32 core computer with hundreds for gigabytes of ram. Do you mean their data centers?

My dev workstation at work has 20 Xeon cores w/ HT (so 40 threads), 64GB RAM and a 1TB NVME SSD. All that hardware sees plenty of use when compiling large C++ applications.

My home machine has 4 i7 cores w/ HT, 32GB RAM & a 1TB SSD. Compiling stuff on that one is ok, although quite a bit slower.

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#138

Earlier quoted context omitted.

I don't know, WebAssembly compiles to very small blobs (if done right), you can get a lot of functionality out of a few KBytes. Imagine if we could throw out all the high-level crap from the browser core (WebAudio's node graph, all the video and audio codecs, HTML/CSS/JS engines with all legacy features they need to support, etc etc... and replace that with wasm modules which are only loaded on demand. Then browsers…

I’ve not seen much WebAssembly “done right” to date; IME it is most often employed to spew gargantuan legacy C++ applications verbatim into the browser to avoid having to understand which parts are actually desired, whether and how they can be unpicked from the rest, and whether they are trivial enough to actually just reimplement in Javascript or otherwise as standalone modules. This does not bode well for the utopi…

Check out these samples: https://floooh.github.io/sokol-html5/, the wasm blobs there are between 8 KByte (for the clear sample) and 210 KByte (for the ImGui sample), all compressed size as downloaded by the brower. Most of the samples are done in C, the ImGui sample is C++. You have to pick the right C++ subset ("Modern C++" is pretty much what not to do if you care about binary size, instead use the C++ subset that's common in the embedded world). It's much easier to write slim code in C since this is a much simpler language and it's not so easy to hide a lot of crap under 'abstractions'. Of course if the C++ codebase is already bloated that's impossible to get small for WebAssembly.

Common sense is still required (which is unfortunately very rare in the modern programming world).

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#139

Because it is 2018 and people have forgotten how to static HTML. All that lovely rendering code in your browser goes unused as people rewrite it in Javascript, badly; or even in C++ and then compile to web assembly, that’s all the rage now, because why stick with one layer of abstraction when you can involve three? Oh, and of course everyone rolls their own, so that website with the dancing pigs not only has its own…

Aww, come on. People want and expect websites to be very close to web applications that react to who you are, what actions you take on the page and a myriad of other factors. That's just not possible with static HTML.

I fundamentally disagree. I don’t think ‘people’ really do want that.

That reminds me of the thinking during the 90’s and early 00’s that everyone somehow must want 10 browser toolbars that spam them with ads all the time.

Re: Ask HN: One tab on Chrome takes about 100MB memory, why?

#140
post #104

Earlier quoted context omitted.

I consider 2GB acceptable, 4GB normal, and 8GB high-end (maybe even overkill).

Strange, that's the metric I personally used around 2008. Haven't ran into a computer with less than 16GB for the last few years.

A rather popular hardware site in a developing country, but one on the upper range of "developing". So probably better off than 60% of the world's population:

399 laptops with 4GB of RAM: https://www.pcgarage.ro/notebook-laptop/filtre/memorie-capac...

548 laptops with 8GB of RAM: https://www.pcgarage.ro/notebook-laptop/filtre/memorie-capac...

Less than 200 laptops, in total, with 16GB RAM or more. So probably less than 20% of the laptops on sale have that much memory, in 2018.

The "real" world is quite different to what us folks in IT see in our corner of the world.

Post reply on HN