by saagarjha · 3y ago · 0 comments
$ time rm -rf Xcode.app
real 0m39.850s
user 0m0.429s
sys 0m29.153s
$ time rmz Xcode.app
real 0m36.476s
user 0m1.468s
sys 1m59.916s
It's a little bit faster, but not by much. Despite claims that it runs in parallel, it seems like it really just hits unlink on many more cores and contends on the kernel's filesystem spinlocks rather than doing useful work. So the end result is that rm uses 70% CPU and rmz uses 400% CPU and they basically end up doing the same thing.(FWIW, I don't use rm when deleting Xcode anyways, because it takes long and I do it too often. When testing unxip I just have it write to a temporary APFS volume and wipe it in between runs, which takes all of 10 seconds.)
[1] https://github.com/SUPERCILEX/fuc/tree/master/comparisons
I would guess that macOS, being targeted at desktops and the typical workloads being run on them, hasn't received the same level of scrutiny in this particular area.
Not the reason OP is deleting Xcode, but you'd be surprised at how buggy a lot of stuff involving Xcode can be.
Therefore I update Xcode by downloading the .xip from developer.apple.com/downloads.
$ du -Ash Xcode.app
22G Xcode.app
> $ du -Ash Xcode.app
> 22G Xcode.app
My installation of Xcode only takes up 3.6G and is still fully operational.
As a developer of both desktop and mobile apps, I discovered some time ago that I could delete most, if not all, of the Xcode simulators that I don’t use without affecting the functionality of the IDE. The software is smart enough to download additional assets when you attempt to launch one of the simulators. I believe that, by default, Xcode comes with simulators for the latest versions of iOS, iPad OS, Watch OS, and Apple TV, sometimes including two or three versions for each platform.
I think this is the reason why your installation weights 22G.
"The macOS/Windows implementations are currently equivalent to the *_rayon implementations shown in the benchmarks."
Rayon is pretty good, but clearly suboptimal as evidenced by the benchmarks.