@lizzy@social.vlhl.dev @kimapr@ublog.kimapr.net yeah! btrfs uses exactly the same technique when copying files! although there, the reason is slightly different. although it does save memory usage in Swift, that's usually abundant and even for small arrays CoW is really useful because the act of allocating memory is in itself very slow and constantly copying immutable data upon function calls cab cause tremendous effects on application performance; compared to a filesystem where copying *generally isn't that slow* (I mean, filesystem operations are already REALLY FUCKING SLOW in general) and *it's actually not that often you're copying lots of files without mutating them*; this isn't like a hot path, it can be slow, HOWEVER backups are a thing!! and while backing up on the same volume does NOT help recover from drive failures it can be a very useful way to recover "oh oopsie I accidentally deleted this file and I want it back", and with a CoW filesystem, you can automatically make a copy of your entire filesystem like, say, every day, or even every hour. For one, the backup process is basically a trivial increment so it's very fast, but the main benefit is that it takes BARELY ANY SPACE AT ALL and you only pay for backup costs in the files that change afterwards!!! So, you can have a 3 TB volume with like 2 TB of files on it and hundreds of backups of those files that barely take any space until those files actually change!!!