I put all my shared files on external drive with exFAT file system. Found out later that the default cluster size (128 KB) that macOS allocates for exFAT drives is atrociously wasteful for npm-based projects. The external drive is permanently plugged to the back of iMac's Thunderbolt 3 port.
For 128KB cluster size partition, a 3.5GB npm-based project consumes 81GB of space, yes that's 81GB not 8.1GB. For 4K cluster size partition, a 3.5GB npm-based project consumes 5.44GB only.
I resized the exFAT drive's cluster size to 4 KB, there is a problem when the computer boots though. The exFAT drive affects the boot speed of the computer. Do note that the computer is booting from internal drive (APFS), not from external exFAT drive.
From cold boot to Apple logo, the exFAT drive affects the boot speed of the computer to almost ten minutes.
Here are the other boot speed from various exFAT cluster sizes:
8 KB = 2 minutes 50 seconds
16 KB = 50 seconds
32 KB = 16 seconds
64 KB = 8 seconds
128 KB = 7 seconds
For other file systems cluster sizes:
4 KB APFS = 5 seconds
4 KB NTFS = 5 seconds
For both file systems, they don't affect the boot speed of the computer even if they are permanently plugged to Thunderbolt port.
Ultimately I decided to use NTFS and used third-party software on macOS that can read and write to NTFS drive.
Further space saved by deleting node_modules from npm-based projects by using Yarn Plug'n'Play:
No comments:
Post a Comment