Monterey currently supports two native macOS file systems for general use: Macintosh Extended (HFS+) and Apple File System (APFS). It’s common knowledge that HFS+ was developed primarily for use on hard disks, and APFS for solid-state drives. This article considers whether you should choose to continue using HFS+ or switch completely to APFS.
Being the more modern file system, APFS has many features that HFS+ lacks. Among these are volume snapshots, sharing of free space between volumes inside the same container/partition, improved reliability thanks to copy-on-write, and special file types such as clones and sparse files. The only significant feature of HFS+ lacking in APFS is support for directory hard links, but they are seldom used outside Time Machine backups, and Time Machine now backs up to APFS volumes using a better method in any case.
The most compelling argument for retaining HFS+ is on rotating hard disks, because APFS can result in severe fragmentation, most importantly in the file system metadata, so causing degraded performance; as SSDs don’t suffer those performance penalties, this could be a good reason for continuing to use HFS+ on hard disks, while switching SSDs to APFS.
That argument may hold good for storage which is in active use, such as boot disks and those containing working files, but appears less compelling in more static use, to contain relatively stable archives or backups in which there is limited turnover of files or data. Although objectively assessing the effects of fragmentation is fraught with difficulty, one basic question is whether there is any difference in performance between the file systems to begin with.
To assess this, I’ve measured read and write performance for a range of six modern hard disks, all of 2 TB capacity, and two SSDs, when running HFS+ and APFS in adjacent partitions. Each disk was formatted using Disk Utility in macOS 12.3.1. In that formatting, a single APFS container and volume were created, filling the whole disk. I then repartitioned each disk to shrink the APFS container to half the disk size, and added a second partition in HFS+, giving two volumes of equal size, one APFS and the other HFS+.
Hard disks were connected to a Mac Studio Max using their manufacturer’s supported interface and supplied cable, most to a USB-A port. The two SSDs were connected using the same CalDigit TB4 cable to a TB4 port.
Transfer rates were then measured using Stibium 1.0 (55). For each disk, the sequence of measurements was:
- write 160 test files (over 50 GB total) to the APFS volume,
- write 160 test files to the HFS+ volume,
- read 160 test files from the APFS volume,
- read 160 test files from the HFS+ volume.
By alternating tests to the two volumes, chances of caching were minimised.
On one of the hard disks tested, the order of volume creation and testing was reversed, so that the disk was initially formatted in HFS+ with the APFS container being added afterwards. During testing, transfer rates for the HFS+ volume were measured before those for APFS.
Measured write rates using APFS were much as expected:
- hard disks ranged from 124-149 MB/s
- a Samsung X5 SSD quickly filled its SLC write cache, and only achieved 687 MB/s overall
- a Samsung 980 SSD delivered the maximum for its enclosure, of 1.5 GB/s.
All hard disks tested were faster writing to APFS than HFS+, but there was no difference in the two SSDs. Expressed as a percentage of the APFS write speed, APFS was 20-22% faster for the hard disks.
Measured read rates using APFS were also as expected:
- hard disks ranged from 127-149 MB/s
- a Samsung X5 SSD achieved 2.6 GB/s
- a Samsung 980 SSD delivered the maximum for its enclosure, of 1.6 GB/s.
All hard disks tested were also faster reading from APFS than HFS+. Expressed as a percentage of APFS read speed, APFS was 14-23% faster for the hard disks. The two SSDs were slightly faster when reading from HFS+ than APFS, by 4% (980) and 9% (X5).
These results are summarised in terms of percentage differences in the table below.
However, when the order of partitioning and testing was reversed on one of the hard disks, that also reversed the advantage in transfer rates:
- APFS write rate fell from 148 to 116 MB/s, HFS+ rose from 116 to 148 MB/s.
- APFS read rate fell from 149 to 124 MB/s, HFS+ rose from 118 to 149 MB/s.
That demonstrates that the differences seen between HFS+ and APFS on hard disks was the result of the physical location of the partitions on the hard disk platter, rather than anything inherent in the file systems themselves.
- When tested with initially empty file systems, there is no evidence of any inherent difference in read or write rates for hard disks formatted in HFS+ or APFS. The only significant difference between measurements is accounted for by differences in the physical location of partitions on the hard disk.
- As a disk fills with files and their data, their performance is expected to fall faster when using APFS. When used for more static storage, this may not result in significant degradation.
- APFS may thus remain acceptable for use for more static storage on rotating hard disks.
- Differences in write performance on SSDs don’t appear significant.
- HFS+ may have a small performance benefit when reading SSDs, but this is unlikely to be noticeable.
- HFS+ should only be considered for retention as the format of active working hard disks, where APFS features aren’t required. For all other storage, APFS should be preferred.
- Boot disks are now required to use APFS. Although it’s possible to install and boot Monterey from a hard disk, it’s not recommended except in an emergency because of the marked performance penalty.
- This doesn’t apply to RAID arrays or shared storage, such as that containing sparsebundles, which need separate assessment.
I’m very grateful to Paolo for persuading me to repeat tests with the partition order reversed, so demonstrating that differences seen are the result of the physical location of partitions on the platter.