29 ms·
There was a meme when I was at Google (~2012) that went: "What would you do if you had 16GB of RAM?" "I'll tell you what I'd do with that. 2 Chrome tabs at t
by nostrademons 6y ago
There was a meme when I was at Google (~2012) that went:
"What would you do if you had 16GB of RAM?"
"I'll tell you what I'd do with that. 2 Chrome tabs at the same time."
(Superimposed over the scene from Office Space.)
(On a more charitable note, I worked with the Chrome performance team on a few occasions. The reason for Chrome's massive memory requirements is that they make memory vs. CPU/performance/security tradeoffs on a regular basis, and usually make them against memory. For example, the reason you can have smooth animations in Chrome is because there are multiple in-memory representations of the layout and changing a CSS property relies on cached parsing/cascading/layout decisions and only needs a repaint on the GPU, using blocks of the page that have been pre-rendered into a texture. For another example, the multi-process architecture that gives each webpage isolation from another is a lot more RAM intensive than a shared-state architecture that could share common components, like say the object code from compiling shared JS libraries.)
- jmilloy 6y agoWould be a dream as a user to be able to choose between cpu-optimized or memory-optimized modes.
- tinco 6y agoWhen would you ever not opt for a cpu optimized mode? Cpu's can't get faster, and you can always get more memory.
- jabirali 6y agoA perhaps more useful tradeoff would be if one could disable a subset of CSS/JS with a simple switch in the settings, so e.g. transition animations are skipped but the webpage is otherwise readable. I think I have yet to see a webpage that uses animations in a way I enjoy, even when they’re smooth. (The same goes for most PowerPoint transitions and window manager animations...)
- alpaca128 6y agoI also go back to switch off animations wherever I have the choice. Some animations look really good but long term they all just feel like fancy input delays.
- rubyn00bie 6y agoI, rather unfortunately for myself I suppose, find most animations on the web or even CPU intensive sites to be... well, quite frankly, piles of shit. I would opt to stop letting web page authors just mangle my CPU cycles because they've opted to poorly animate an SVG or some HTML element. If anything I'd prefer each got a CPU budget and that was all they could use, unless they request more CPU time from the user, then voila! People who want to be annoyed can be, and the rest of us can go back to "browsing the web."
- robin_reala 6y agoFor most people you can’t get more memory without swapping in your device for a newer one. All mobile phones, all tablets, and a good chunk of laptops have soldered in memory with no expansion possibilities.
- adrianN 6y agoGetting a faster CPU is about as difficult as getting more memory for almost everybody, because people need to buy new machines to do so. Either because they own a machine that can't be upgraded (hello soldered ram), or because they don't have the technical skills to do so. Personally I'd rather wait longer for things to complete than have my whole system grind to a halt because it starts swapping like crazy.
- gruez 6y agobrowser vendors can barely keep one renderer/javascript engine free of 0days, I can't imagine how secure a browser would be with double the codepaths.
- eurasiantiger 6y agoNothing is free of 0days.
- DaiPlusPlus 6y agohello_world.c is still pretty secure, right?
- traverseda 6y agoNot since spectre.
- thih9 6y agoI wish this was a display option instead. I.e. “Disable animations in all web pages (gracefully)”.
- cercatrova 6y agohttps://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...
- ficklepickle 6y agoThere is a CSS media query for that: prefers-reduced-motion Now whether any sites actually make use of it is another matter. Also I don't know how the user would enable it. Perhaps an OS-specific, system-wide setting like dark mode. https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion https://developer.mozilla.org/en-US/docs/Web/CSS/@media/pref...
- dullgiulio 6y agoAgain, disabling features is a feature given to the site developer, not to the visitor, who's actually running the code. It would be so much better if browsers were User Agents and respected user settings before the will of the site creator.
- robin_reala 6y agoThey are? * { animation-play-state: paused !important; transition-duration: 0s !important; }
- duskwuff 6y ago> Also I don't know how the user would enable it. In Apple products, it's exposed as an accessibility option: macOS: https://support.apple.com/guide/mac-help/reduce-screen-motion-mchlc03f57a1/mac https://support.apple.com/guide/mac-help/reduce-screen-motio... iOS: https://support.apple.com/en-us/HT202655 https://support.apple.com/en-us/HT202655 tvOS: https://support.apple.com/guide/tv/reduce-screen-motion-atvb1f949820/tvos https://support.apple.com/guide/tv/reduce-screen-motion-atvb... (which also disables autoplaying previews!)
- xenomachina 6y ago> The reason for Chrome's massive memory requirements is that they make memory vs. CPU/performance/security tradeoffs on a regular basis Do they actually test both approaches, or is it more a matter of "we can code it way A or way B, and way A uses more memory, but we think it'll be faster"? Many years ago I worked at Watcom, back when they made "the" C++ compiler for DOS games. (Doom, Descent, Duke Nukem 3D, and Tomb Raider all used it.) The compiler had various optimization settings, and some optimized for size, while other optimized for speed. The compiler was used to compile itself. They normally compiled with the "optimize for size" settings enabled, but one time they decided to try optimizing it for speed to see how fast it could be. It turned out that optimizing it "for speed" made it considerably slower because of the cache.
- gsnedders 6y ago> Do they actually test both approaches, or is it more a matter of "we can code it way A or way B, and way A uses more memory, but we think it'll be faster"? A lot of memory consumption is various caches (at various layers); those caches weren't added for no reason, they were added because they provided a demonstrable a perf gain.
- esprehn 6y agoThe chrome team does exactly what you describe. They both compile for size on some platforms (because in practice it's faster for several reasons) as well as spend a lot of time researching speed vs memory trade offs and making those deliberately. In recent times the memory trade offs were also sometimes related to reducing power consumption.
- phamilton 6y agoThere was a lot of debate back in the Gentoo days about whether to compile with -O3, -O2, or -Os -Os meant faster launch times, which for desktop Linux made sense, but in classic Gentoo fashion a big group used -O3 and then did a bunch of hacks to make sure binaries would be loaded at startup and never be evicted from memory (even if the application itself wasn't running). Gentoo was delightfully silly about this stuff, and mostly self aware that it was excessive.
- fouric 6y ago> The reason for Chrome's massive memory requirements is that they make memory vs. CPU/performance/security tradeoffs on a regular basis, and usually make them against memory. This is generally a good trade. Memory is not very useful (modulo filesystem caches) when you're not using it, and has a very low cost when you are (extremely tiny power consumption). CPU cycles cost power (leading to heat dissipation and battery life loss) when you use any amount, and latency when you use too much. Latency directly affects user experience and efficiency, which is a much higher cost than "my RAM is at 75% usage". Additionally, Chrome's tradeoff is such that it works out better on cheaper devices. Memory is far cheaper than more powerful processors - which also reduce battery life, which is even more expensive. On more expensive devices, you have all the memory you need for Chrome anyway, so you're just getting better latency. Finally, there are very few cases where you should have a large number of Chrome tabs open anyway. Multi-tasking is impossible (the human brain simply doesn't support it) and rapid context-switches are inefficient. As much fun as it might be to have 5 tabs open on each of 10 different topics, you're simply decreasing your productivity and capacity for focus. Even when doing multi-disciplinary research, there are a ton of ways to get around the problem of running out of memory due to Chrome tabs: printing pages to PDF, turning off JavaScript, downloading research papers and reading them in a native PDF viewer, extracting content from webpages and inserting into local documents, and the classic using darn bookmarks instead of tabs like they were intended to be used. (of course, in an ideal world, all web browsers would use absolutely no memory or processing power whatsoever - I'm just defending this particular engineering tradeoff)
- Someone 6y ago“Memory is not very useful (modulo filesystem caches) when you're not using it, and has a very low cost when you are (extremely tiny power consumption” One problem is that CPUs have various ways to use less power or even switch off parts when not in use, but you always pay the same for RAM. For battery-operated devices that sleep most of the time such as smartphones, that means being careful with memory usage is the way to go. I think that’s part of the reason iPhones ship with less RAM then Android devices (reference counting needs less RAM than garbage collection for the same performance level)
- Veedrac 6y agoHaving seen the realtime-rendered Horizon Forbidden West trailer, justifying Chrome's ‘smooth’ animations this way is like stepping into a parallel world. I can't even scroll Twitter without stutter on my hefty gaming laptop, my browser (the whole thing! not just the tab!) often freezes for 10+ seconds when first rendering a page, and toggling Reddit's sidebar takes half a second. To the extent Chrome's anything can be deemed ‘smooth’, it's because computers are fast, not because they made some clever space-time trade-off.
- tryauuum 6y agoWhat kind of websites need 8GB per tab? I have never had problems with chrome or firefox on my 4GB box. EDIT: someone in this thread posted this: I can't even scroll Twitter without stutter on my hefty gaming laptop, my browser (the whole thing! not just the tab!) often freezes for 10+ seconds when first rendering a page, and toggling Reddit's sidebar takes half a second. This explains a lot, I (almost) never visit twitter or reddit.