New Chrome features to save battery and make browsing smoother
blog.google
blog.google
So I would rather choose a browser with 2x-3x lower benchmark performance if it could consume 2x-3x less memory. Firefox is basically unusable on a 2Gb system as long as you useit more than 15 minutes.
One of the solutions could be to freeze and compress background tabs. There is no need to keep in memory HTTP caches, localstorage, heavy JIT caches, CSS selector dependency trees, JS bytecode, DOM nodes without JS expandos attached. Freezing background tabs also allows to save energy.
Limiting RAM has become a silly market segmentation tactic, and I’d say there is absolutely no reason to buy a PC with less than 16 GB of RAM these days. It’s downright stupid you can still buy machines with 6 GB. Better to buy several generations down or used—old CPUs are still perfectly serviceable unless you’re planning to submit to some serious C++/Rust compiler punishment. (Says the person with an 8GB dual-core Haswell that is showing definite signs of obsolescence, but I still stand by my words.)
Source: did just that on a daily basis on my recently replaced 10 year old laptop. I probably would have even been able to handle 2Gb assuming Firefox was the only application running.
if it's not upgradable then it's up to the user to determine if it's worth it to replace the whole laptop, but if it has 4GB of RAM its other specs are probably gonna be outdated as well and you can buy very good refurbished laptops for under 300€ these days...
Also, even 15-year old CPUs are still pretty fast and can do billions arithmetic operations per second. Only because Intel decided not to add several more address lines which cost them basically nothing, these machines have to be thrown away.
You know, people don't have unlimited money.
Of course. I mean that as far as I can see one should normally save on just about everything else, including going back multiple CPU generations (let alone giving up on a discrete GPU) and buying a used laptop instead of a new one (in case it’s a laptop), before opting for less RAM. (I’m not including Chromebooks in this calculation, as those have never been available to me.)
> Firefox is basically unusable on a 2Gb system <...>
I just had a look at one of the largest laptop retailers in the UK, and they don't sell laptops with less than 4GB anymore. Checking the steam survey [0] (which is biased towards gamers but still a very representative sample of PC owners and users), almost 95% of people have more than 4GB. Realistically, 2GB and even 4GB devices are at the absolute bottom end of devices that are in use in desktop computing.
Mobile is a different beast, but android has a specific lightweight OS for 2GB devices, and 4GB devices are budget at this stage. 6GB is the requirement for full-fat android. [1]
You may or may not agree that it's necessary, but the reality is that 2GB device are bordering on obsolete in 2022.
> One of the solutions could be to freeze and compress background tabs.
Firefox supports this already [2]
[0] https://store.steampowered.com/hwsurvey/Steam-Hardware-Softw...
[1] https://www.xda-developers.com/android-12-performance-class/
[2] https://support.mozilla.org/en-US/kb/unload-inactive-tabs-sa...
Having two laptops is twice better than having just one, so I decided to continue using it. Maybe I will connect it as a virtual monitor for a second laptop (then 2 Gb should be enough), but I am not sure if Wayland supports this.
Also, even if new laptos have 4+ Gb of RAM, there are still 5-10 years old models in use.
Can you please point out which laptop in 2022 is being sold with 2GB of ram limitation? Really curious.
The smallest I could find for sale in my country is 4GB and I had to look really hard as they're not cheaper than buying something with 8GB of ram or they're just ARM Chromebooks.
Even most budget chinese Android phones rarely ship with less than 4GB of RAM anymore. So you made me very curious about 2GB laptops retailing in 2022.
Edit: wow, why the downvotes guys? Is it against the rules to aske questions?
By the way, one of the buyers wrote that it is "great for studying" and another wrote that "it is confortable to use with Linux".
[1] https://www.dns-shop.ru/product/829ba65324bded20/133-noutbuk...
There are tons of refurbs, new-old stock and blatant lies on Amazon so you can really expect someone who doesn't know shit (eg only knows and bother about persistent memory, completely oblivious about RAM) can buy a device with 2Gb RAM in 2022.
Many people still buy those absolute bottom end of devices.
Why does my Macbook Air which cost me A$1,499(!) have soldered, unupgradable RAM?
I can SMD solder but it's still far too risky just to save a few hundred dollars
Of course they could just deaig and sell new motherboards with new chips for the older laptops chassis, like framework does, but knowing Apple, such user upgrades will not happen.
For example, an HP Elitedesk 800 mini (very small, so using SO-DIMMs and integrated everything - basically a non-portable laptop) will run you around 800 Euros, while the "equivalent" Elitebook 830/840 will run you 1500 euros. Specs are "similar", same generation mid-level i5, same RAM, same SSD. Main difference is the Elitedesk will have desktop-class CPU. Throw in a cheap HP screen (200 euro - Elitebook laptops have ridiculously bad screens, so that's fair), and you get to 2/3 the price of the laptop.
Apple is blatantly anti upgrade (just see the SSD situation on their desktop offerings) but that's not the only reason they solder stuff down.
I believe Dell is working on a new, open design for PCBs where this performance problem is smaller or even nonexistent. You lose the ability to do partial upgrades with the new system but gain the performance impact that is driving some companies to soldering down RAM for performance reasons.
For devices with slower RAM there is no excuse. Just an upsell to make you pay $100 for 8GiB of RAM.
Also, in cheap laptops soldered RAM often has lower speeds, same as replaceable one.
And if RAM has to be soldered, then the board with CPU, GPU and RAM could be made replaceable so that you can upgrade it later without buying a new device. Obviously, manufacturers don't want that.
Dell is on a new replaceable RAM standard. It's already been designed for their own products, but they're working with JEDEC to make it a standard: https://www.storagereview.com/review/dell-camm-dram-the-new-...
I also prefer upgradeable laptops over bleeding edge performance but the reality is that most consumers never upgrade their laptops (and if they do, only to add more storage). Until a large amount of customers start factoring repairability and upgradeability into their purchasing decisions, we'll only see soldered down RAM.
One such example is the HP Elitebook 1040 G9. The tablet-like version has soldered RAM, whereas the regular has external modules. They both use 4800 MHz DDR5.
For comparison, a cheap removable DDR4 module at 3200MT/s can provide theoretical bandwith around 25 Gb/s and two of them can provide 50 Gb/s which is also very fast (for me) and good enough for many tasks. More expensive DDR5 modules can provide up to 50 Gb/s bandwidth per module, and four of them give you 200 Gb/s of theoretical throughput.
So I don't see problems with using removable DDR5 modules. They are good enough, and being able to expand RAM cheaply is more important, than getting 2x bandwidth, that you cannot utilize, at a premium price.
<4GB devices are ~10.6% of the mix. 4GB are 20.8%.
Sure, I didn't play games on it. But for regular "office use" I never had any performance issue.
For my current laptop, I specifically wanted a model without a dedicated GPU. Didn't want the hassle of dealing with that (I run Linux) and also there was no reason for me to pay extra for something I don't need. It was cheaper for me to buy a dedicated GPU for my desktop.
But of course there are cheaper laptops with 4Gb RAM, so this one seems more like an exception. There are even tablets that cost less and have 12 Gb of RAM, although they are sold by suspicious sellers from China.
That's Bay Trail Atom. Launch date: Q1'14, two years after the platform launch, two years before the platform sees the latest release.
Or this is old new stock (of Bay Trail Atoms?) of something completely insane. Come on, 8 years! I had Acer W4-821 tablet with similar CPU in 2014! And was quite hampered by an upgrade to Win10, though I managed to run Virtual Box with CentOS on it to live test some code.
https://ark.intel.com/content/www/us/en/ark/products/80274/i...
There's absolutely no point in buying new cheap laptops these days.., Big businesses are always getting rid of 5 year old laptops because their 5-year warranty expired, and the prices get low because they're old, but those 5 year old laptops are comparable to 1 year old laptops these days, cause in 2017-2021 there has been 0 improvements in the laptop world...
I wanted to replace my top of the line 2017 Dell XPS 9560 in 2021 after 4 years of use and literally didn't find any laptop that was noticeably better to justify paying for it....
FF can do it, but it only triggers in low ram situations and detection is wonky, disabled on Linux.
I found the auto tab discard addon [0] to be a game changer on my low ram machine. It just works (though not on mobile).
[0] https://addons.mozilla.org/en-US/firefox/addon/auto-tab-disc...
Huh? When the system is getting close to running out of memory, isn't the least-recently-used memory swapped out to disk by the OS? And if you're using an SSD like nearly everyone these days, it isn't even noticeable.
Freezing tabs is a good idea to ensure the memory stops being accessed precisely so it can be swapped... but besides this, why not let the browser use all the memory it needs, and just let swap do its job? It seems entirely redundant for a browser to try to save memory by essentially implementing its own secondary swap strategy.
After all least-recently used memory is swapped out, the time comes to swap out recently used memory and it becomes noticeable, especially with a spinning disk with 400Kb/sec random write speed.
Swapping is extremely ineffective. Unloading a tab allows to use sequential write which is orders faster than random write even with SSD.
For keeping things open in the background that aren't being actively used, swapping is extremely effective.
I don't see any good reason why background applications should get swapped out by the OS, but background tabs should be handled by a different mechanism.
(And I have no idea what sequential write has to do with anything...? If you're talking about coming back to an old tab, loading it from swap will nearly always be faster than reloading over the internet, no?)
For HDD, sequential write speed can be 50 Mb/s and random write speed for 4Kb chunks can be as low as 400 Kb/s. For SSD, there is also a difference in speed on order of 50x.
Swapping uses 4Kb chunks and therefore uses the drive in the most inefficient mode. Alternative mechanism can employ faster and effective sequential access.
If swap needs to write 10 MB, in whatever chunk size, it will send them one after the other, just like the file system. Regular file systems don't have 100 MB sector sizes, either.
> For SSD, there is also a difference in speed on order of 50x.
I highly doubt that. Source: running fio on my SSD. SSDs actually can take advantage of parallelization, writing to multiple places at the same time, which a spinning drive obviously can't do.
This article [1] contains benchmark results for several SSDs and a good HDD. You can compare sequential read speed in fastest mode (SEQ1M) and random read speed in slowest mode (RND4K) and see that there is a huge difference for both HDD and SSD on order of 50x (for SSD) and 300x (for HDD).
HDD is very slow for random read/write access because it needs to wait until the desired sector will spin underneath the head, one spin takes approximately 10 ms, and on average you need to wait half of that time.
> For your HDD to reach that speed in sequential write, the free space should be contiguous.
If the file system is smart enough to allocate large chunks of free sectors then the write will be sequential. If there are no large contiguos chunks then maybe you need to defragment your drive using standard Windows tools (don't know if there are similar tools for Linux) otherwise write speed will be very low.
> SSDs actually can take advantage of parallelization
This doesn't matter when you need to swap pages in because you retrieve one page after other and cannot parallelize this (as pages are swapped in only when they are accessed by the program).
But I can agree that buying $30 SSD is probably the cheapest way to speed up an old computer.
[1] https://glennsqlperformance.com/2020/12/13/some-quick-compar...
It would seem that Linux swap uses the block device layer to handle actual I/O for swap. So, I think that if it only needs to write or read one single page at a time, then sure, it will be slow. But if you need to swap out a sizeable quantity of memory (meaning multiple pages), it will need to write or read multiple pages "at a time". Linux also tends to group pages together. Since reading and writing is async [0], as soon as the io operation has been sent, the next page will start to be handled, even if the actual io to disk hasn't finished. So, in practice, it's very likely that there are several IO operations happening at the same time from the drive's point of view.
The system is also highly likely to be doing some unrelated I/O, which is why parallelism helps a lot.
This is where the SSD will shine, because it will absolutely be able to handle multiple small IOs in parallel [1]. And also where, presumably, queue-ordering in the case of spinning drives can help here, too, by optimizing the order in which the paging operations will occur.
I'm not familiar with Windows, but I'd expect things to work somewhat similarly, especially since the swap is backed by an actual file system (but I don't know if the swap files have any properties that make it "special" - though I wouldn't be surprised for that to be the case).
---
[0] https://www.kernel.org/doc/gorman/html/understand/understand... look for heading 11.7
[1] See RND4K / Q32T16 in your benchmark, where the factor is only 2.
The only performance issues that are actually relevant here are if you get into thrashing because you've run out of memory totally (no longer pre-emptive), but that doesn't happen in normal usage. Or when you're swapping memory back in for an app/page that's scattered among many 4 KB pages on disk... but the point is that should still be faster than reloading the page over the internet! (And on SSD's it's blazingly fast since fragmentation on disk barely even matters.)
I don't think so. HDD can do approximately 100 IOPS, and with 4kB pages that gives you speed of 400Kb/s.
I had different cases when system worked poorly when there was not enough RAM. All of these happened to me on 4Gb Linux system:
- when a heavy page is opened in Firefox and it tries to allocate more than 500 Mb of RAM (for example, Google Street View that leaks RAM), the system swaps out Gnome desktop compsitor, and everything freezes for several minutes, you cannot even move a mouse or switch to a text console. Often the only solution is reboot. Why cannot Linux protect Wayland compositor from being swapped out I don't understand.
- when the system turns off the screen, it can swap out desktop compositor because it is not used, and there is a freeze for 20-30 seconds when you try to wake up the system. Why cannot it swap out something less important I don't understand.
So in practice swapping can produce long freezes when the system becomes completely unresponsive. I cannot agree with your statement that getting a page from swap is faster than loading from Internet.
If instead of swapping separate pages the system swapped out and in whole processes, the situation might be better.
By the way, out of curiosity I tried to investigate who uses so much memory that 4Gb becomes not enough by summing PSS (proportional set size) of processes, and I never got 4Gb used, it always was about 2.6-2.8 Gb used after which the system becomes prone to sudden freezes. "free" command also never showed number of "used" RAM above 3Gb. I guess Linux has not only issues with swapping, but also with counting used memory as well.
And I was clear I wasn't talking about severely underprovisioned machines, such as you are describing. In normal usage where background apps/tabs are swapped out preemptively, there is no performance hit at all. And then when they're reloaded from swap -- yes, it's extremely fast. It's like loading a web page from your local drive, only even faster because it doesn't have to be interpreted.
If you're dealing with freezes of 20 seconds to several minutes, your machine is severely underpowered or somehow seriously misconfigured. You need to upgrade, not complain about how swap doesn't work.
I would much rather incur a swap load time than a page refresh.
Seems like a reasonable bar to test against. 2GB even a decade ago was very low end.
I've been doing front-end dev for almost 20 years and now use Chromium very rarely and only in work related context.
I'm at the risk of sounding naive here, but using any browser that is not Chrome makes the world a slightly better place (just a tiny bit), same goes with helping your non-techie friends do the same.
(yes, I know Safari is not perfect, but Chrome is cancer/storefront and it is one often things that make use collectively a tiny bit more stupid)
It’s not perfect but the balance of effort versus results is pretty good imho. The only thing I really miss is being able to disable JS per site, instead of globally, which Safari doesn’t allow :/
> “Chrome 12 [an old version] was the best Chrome", but since I’ve come to see underneath that for me what I wanted was a fast tight browser, and once I had that, pretty much by definition most subsequent work was just gonna make it worse.
Safari is today’s fast tight browser I dare say.
I gave Safari a try and I loved it, but the lack of Profiles made me switch back to Chrome. I hope they implement such feature in the future.
It's not as good as FF containers or separate profiles in terms of sandboxing/isolation, but in terms of UX it's pretty neat. I keep HN and all of my distractions in one tab group then just hit one key to hide them and only see the work context, all distractions are gone.
This approach works well enough for me because it feels super simple, although I miss FF containers a little bit.
From the perspective of Google, your browser or your phone are just ad spaces.
Apple sells ads, so that rules out Safari.
Microsoft sells ads, so no Edge or Internet Explorer.
Mozilla sells ads, so no Firefox.
Brave sells ads, so no Brave.
What’s left? Lynx?
Think of it this way: what percentage of the revenue of each of these businesses comes from advertising? Where can you put your (understandably) limited trust given the limited list of options?
There's a huge difference between the incentives of Alphabet and, _say_, Mozilla from the revenue source pov.
^1 ca $400M paid to Mozilla for search partnerships by Google, per annum
^2 probably ca 10-15B paid to Apple, pa
How would you answer your own question?
> Microsoft sells ads
> Mozilla sells ads
what?
Anyone have ideas why the tab's memory contents can't be offloaded to SSD and restored instead? Personally I don't like losing state (e.g. filled in forms, scroll position, deleted posts, etc) from using other extensions like Great Suspender.
2. it's very messy data, it's a bunch of seas of nodes (the DOM, the JS heap, the styling info, etc...)
3. I wouldn't be surprised if it was data which isn't fully isolated (e.g. shared style caches), meaning it first has to be fully forked to resolve into a self-contained bundle
OS have the ability to just freeze and store / restore memory, but I'm not sure they give that capability to use processes.
Image-based systems (smalltalk, self) would probably be a better model for a live tab, but it still requires things to line up.
For comparison, if you don't unload the page completely, and system gets into swapping then there will be random access pattern with speed about 400 Kb/s on a HDD. So it is faster to unload 500 Mb sequentially than swap out/in 5 Mb.
Chromium already discarded tabs when the system memory pressure was high, what the memory saver brings is a smarter policy [0]. For example, tabs that are inactive for more than two hours will be automatically discarded now.
[0] https://source.chromium.org/chromium/chromium/src/+/main:chr...
1: Load NBC.com (or any other regular media site) in a "naked" web browser (just a plain browser, no ad blocking, noscript etc)
2: Open dev tools -> networking tab
3: Study the activity, look at requests made, size of requests, data the requests contain (remember, YOU are paying for these requests in terms of impact to battery, bandwidth, electricity usage etc)
I can see MB's of data transferred from my device, every time I scroll more network activity is performed (100's of requests per MINUTE), this is all made possible by "JS" which is the single biggest resource hog of any modern browser.
Turning JS off (whilst obviously crippling some pages) results in HUGE savings of bandwidth, reducing battery impact AND increasing privacy :). (You can also use noscript to allow/deny certain scripts from loading, and you'll be surprised how many pages work with JUST the root domain enabled, thus every third party script is not vital to the functioning of the page)
I seriously think modern browsers (including Firefox) need to implement features to reduce the amount of network requests a page can make, including to third party websites, and limit the amount of data a single page can consume. I'd call it a "browser firewall" similar to tracking mode, preventing third party requests entirely
Data does cost, contrary to what others make think, especially on mobile lines when out and about.
So yeah, let's fix that first.
Since I upgraded a couple days ago, I'm seeing that indeed every tab completely reloads when I switch to it if I haven't used it in a few hours.
But now I'm kinda worried that I'll leave something half-written and it'll be gone. Unfortunately there doesn't seem to be any way to test that in advance without waiting a few hours.
I also often rely on a long article being scrolled halfway through to save my place, or a long video I'm in the middle of, and I'm worried that my spot will be lost as well.
I find it extremely odd that they're not even mentioning anything about that -- e.g. whether you will lose data/place and you should disable this feature if that's unacceptable, or whether it does some fancy stuff to restore the state of anything that's a form, contenteditable, scroll position, or playback location.
There should be a middle ground that can pause all resource use, and then resume it, without reloading state. Google, Amazon, Twitter, Youtube subframe/embeds are resource hogs.
So many times a page has an infinite paint loop that sucks 100% of a cpu core, and I with I could just… turn the dial down a bit to save the battery.
Here’s hoping that energy saver lives up to its name.
Feels weird to have the performance control inside an application, instead of it following what has been set by the OS.
OS are general-purpose system, it's always been the case that applications being known workload they had better knowledge of what they need (it just doesn't matter to most of them). That's why you can tune your db configuration, or you can police individual processes using various tunables, or you can ship your program with a better allocator than f'ng glibc malloc.
And a modern browser is a pretty complicated process manager, the OS has no understanding of what the various processes do or what state they're in.