APFS vs HFS+: benchmarks on 2017 MacBook Pro with macOS High Sierra

APFS vs HFS+: benchmarks on 2017 MacBook Pro with macOS High Sierra

<– Page 1: dd, ioping, sysbench

blogbench

Blogbench is a filesystem stress tool that imitates a hosting environment. While it sounds like it may not be an ideal benchmarking utility for a laptop or workstation, Blogbench creates multiple write / read / rewrite operations, uses 8K chunks of data and was used primarily because of multi-threading.

HFS+

$ blogbench -d /tmp

Frequency = 10 secs
Scratch dir = [/tmp]
Spawning 3 writers...
Spawning 1 rewriters...
Spawning 5 commenters...
Spawning 100 readers...
Benchmarking for 30 iterations.
The test will run during 5 minutes.

  Nb blogs   R articles    W articles    R pictures    W pictures    R comments    W comments
       173      1151009          9724        714923          8232        591264         24967
       295      1248120          6876        820262          7104        653722         17051
       423      1165883          6565        780699          6566        602302         17566
       549      1217983          6678        819287          6930        627100         17641
       674      1231432          6814        824949          6106        643147         17867
       789      1238335          6328        825122          6593        633810         17028
       918      1142464          6889        758554          5575        586111         15823
      1049      1218096          6452        811547          6313        631171         16172
      1178      1236903          6433        815218          7004        632066         16580
      1302      1233998          6673        818920          6080        640355         16687
      1424      1213624          6134        806283          5911        630331         17029
      1555      1198290          6217        795245          6848        608787         16082
      1679      1214499          6622        814224          6504        634264         17132
      1804      1213402          6118        818276          6604        625071         16453
      1925      1145822          6224        768443          6179        596363         16692
      2043      1011932          6256        681732          6054        524392         15582
      2149       903087          5426        608006          5470        471889         14687
      2224       699150          4501        473189          4431        364103         10130
      2313       698974          5453        480588          4956        362468          9693
      2391       703301          4836        476964          3826        361573         11082
      2459       634829          4385        429054          3872        327426          9732
      2521       617930          4079        419608          3547        326351         11306
      2606       601020          4897        407524          4231        312970          9817
      2691       547121          4999        374539          4648        286723         10793
      2755       537186          4393        366589          3528        278197          9229
      2826       522027          4095        352830          3984        276855         10006
      2889       515149          4171        348546          3526        269746          8865
      2952       499819          4375        342504          3692        262521          8369
      3039       479147          4854        325683          4750        245609          9198
      3109       460991          4309        312898          3977        243007          8359

Final score for writes:          3109
Final score for reads :        549437

 

HFS+ encrypted

$ blogbench -d /tmp

Frequency = 10 secs
Scratch dir = [/tmp]
Spawning 3 writers...
Spawning 1 rewriters...
Spawning 5 commenters...
Spawning 100 readers...
Benchmarking for 30 iterations.
The test will run during 5 minutes.

  Nb blogs   R articles    W articles    R pictures    W pictures    R comments    W comments
       159      1047319          8503        785307          8823        562227         21606
       288      1136847          7540        852135          6789        627755         20764
       409      1142448          7228        834397          7053        643790         18797
       514      1154866          7182        838339          6003        664550         17390
       651      1128184          8180        808199          7666        620338         18508
       762      1108561          7189        789626          6235        599676         16711
       875      1126680          7495        799168          6253        618659         16988
       971      1186674          5945        840671          5337        647478         14431
      1069      1168613          6392        828585          6050        635756         15852
      1165      1182315          6370        839453          5218        629151         16283
      1256      1135763          6520        802254          5377        621340         16424
      1374      1122660          6592        786225          6689        607902         17142
      1496      1154108          7554        809104          6411        630031         17020
      1615      1136312          7191        800905          7023        613196         17841
      1742      1151949          7046        813946          6327        613785         16960
      1865      1049526          6584        735034          5776        563548         16341
      1975       941379          6274        654847          5422        490101         15014
      2075       819056          5604        564476          5038        426068         13126
      2137       701153          3484        483396          3515        365671          7565
      2212       686552          4553        477357          4228        350334          9791
      2291       597985          5008        413336          4683        309456         10302
      2361       559614          4263        386959          3745        281652          8128
      2436       548433          4863        380552          4450        281132          9163
      2518       524520          4388        362262          4043        261152         10281
      2602       483096          4857        332363          4523        248484          9148
      2654       490778          3647        339266          3155        253620          7711
      2721       469509          4633        323205          3686        237544          8368
      2778       443888          3317        308761          3594        227099          8384
      2836       430795          3909        296151          3183        217926          8773
      2900       428126          3777        298828          3891        213226          8244

Final score for writes:          2900
Final score for reads :        529108

 

APFS

$ blogbench -d /tmp

Frequency = 10 secs
Scratch dir = [/tmp]
Spawning 3 writers...
Spawning 1 rewriters...
Spawning 5 commenters...
Spawning 100 readers...
Benchmarking for 30 iterations.
The test will run during 5 minutes.

  Nb blogs   R articles    W articles    R pictures    W pictures    R comments    W comments
       102      1047160          5502        753670          5561        538026         14129
       159      1135784          3373        800554          3489        621399          9167
       220      1155966          3630        821857          3506        627210          9222
       283      1134478          3793        822116          3948        629208          9539
       350      1141677          4197        809858          3640        603920          8624
       421      1148273          4258        817907          4437        594403         10256
       492      1129645          3940        800718          4025        592163         11259
       565      1079623          3852        768173          3878        581369         11097
       642      1107088          4356        788464          3835        607439         11147
       719      1035475          4265        724601          4251        547627         10377
       797      1046436          3782        739908          4038        565335         10028
       878      1109830          4370        774863          4257        588692         10859
       955      1098560          3975        775496          4208        600607         11249
      1031      1076059          4174        761763          4037        569403         10482
      1111      1124256          4690        784115          3899        569054         10825
      1186      1118244          3970        780563          4064        580944         10537
      1257      1110296          3875        776137          3776        565402         10295
      1335      1070674          3806        742652          4127        560730         10386
      1400      1044126          3603        728794          3830        531727         10536
      1467      1104249          3747        773696          3687        586241         10196
      1545      1118511          3963        781478          3940        581093         10103
      1618      1109166          3695        778530          3984        576598          9981
      1692      1077301          3597        756706          4188        554409         10332
      1758      1083163          3567        760868          3893        564309          9836
      1813      1097803          4039        774478          3470        584914          8526
      1857      1054846          3283        736910          2572        555452          7479
      1921       975166          3862        687565          3320        509402          6764
      1973       895691          3528        633044          2968        470482          8184
      2026       775250          3746        545057          3061        414864          9067
      2085       734539          3925        518748          3319        390159          8332

Final score for writes:          2085
Final score for reads :        652794

 

APFS encrypted

$ blogbench -d /tmp

Frequency = 10 secs
Scratch dir = [/tmp]
Spawning 3 writers...
Spawning 1 rewriters...
Spawning 5 commenters...
Spawning 100 readers...
Benchmarking for 30 iterations.
The test will run during 5 minutes.

  Nb blogs   R articles    W articles    R pictures    W pictures    R comments    W comments
        94      1045218          5710        745903          5084        479978         12955
       151      1137694          3745        797434          3796        548218          8757
       219      1147899          4158        813481          3360        577646         10298
       283      1173336          3980        798788          3448        604826          9641
       339      1171412          3436        810892          3788        604117          9378
       402      1155112          3986        811343          3266        591223          9593
       461      1139333          3929        799848          3392        588281          9770
       517      1147593          4287        793375          3303        596903          9621
       592      1136911          4485        771825          3459        593174         10187
       671      1118111          3870        759065          3936        579052         10878
       742      1125614          4106        767965          4026        595456         10544
       808      1117016          3611        765990          3545        590469         10809
       879      1042473          3803        717562          3515        550728         10203
       947      1100384          3989        751434          3447        571741         10531
      1023      1120981          3854        763309          3578        569113         10683
      1092      1111106          3829        758346          3802        584764         10209
      1167      1121487          4234        766284          3374        573690         10278
      1234      1126331          3654        760581          3796        578727         10309
      1300      1109761          3596        745995          3345        567933         10492
      1378      1105059          3913        743056          3597        560403          9865
      1432      1081010          3798        726357          3119        546768          7988
      1486      1100699          3996        742941          3093        565180          9482
      1546      1094152          3772        738002          3717        565265          8525
      1595      1125944          3560        764444          3360        585776          8295
      1653      1117273          4189        762856          2957        582396          9131
      1719      1107814          4499        749517          3531        566665          9195
      1779      1112700          3851        748007          3364        572693          8394
      1837      1050906          3601        713795          3403        540644          8052
      1890      1002112          3155        677631          3038        520734          7153
      1949       845934          3202        573127          3176        444848          8378

Final score for writes:          1949
Final score for reads :        635140

 

 

First – overall scores of blogs written and read for both filesystems

blogbench write score

blogbench read score

 

And now the fun part – Blogbench creates timely statistics, which helps to visualise the transfer over time:

Articles written

blogbench articles written

 

Articles read

blogbench articles read

 

Pictures written

blogbench pictures written

 

Pictures read

blogbench pictures read

 

Comments written

blogbench comments written
 

Comments read

Blogbench comments read

 

 

Bonnie++

HFS+

$ bonnie++ -d ~/tmp/ -m hfs
Version  1.97       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
fs:hfs          32G   547  98 1290032  86 889147  69  1549  99 2275523  90 +++++ +++
Latency             33249us   20326us   19939us   13613us    4438us    2135us
Version  1.97       ------Sequential Create------ --------Random Create--------
fs:hfs              -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 22798  88 +++++ +++ 26146  91 25061  94 +++++ +++ 22166  87
Latency              4638us    1019us    1669us    1126us     123us   11011us

 

bonnie hfs

 

HFS+ encrypted

$ bonnie++ -d ~/tmp/ -m hfs
Version  1.97       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
fs:hfs          32G   752  98 1238481  77 885117  59  1949  99 2111772  83 +++++ +++
Latency             22162us   10980us   18607us   10515us    5660us    1766us
Version  1.97       ------Sequential Create------ --------Random Create--------
fs:hfs              -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 22771  90 +++++ +++ 26532  90 24540  92 +++++ +++ 21315  84
Latency              1964us      81us    2035us     539us      47us    6507us

 

bonnie_hfs_encrypted

 

APFS

$ bonnie++ -d ~/tmp/ -m apfs
Version  1.97       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
fs:apfs         32G   184  99 888304  95 886564  84  1090  99 2014824  87 +++++ +++
Latency             56710us     156ms   13898us    8551us   17769us    1978us
Version  1.97       ------Sequential Create------ --------Random Create--------
fs:apfs             -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 17052  96 +++++ +++ 11066  84 17192  97 +++++ +++ 11912  92
Latency               355us     163us    1590us     252us      51us   10109us

 

bonnie apfs

 

APFS encrypted

$ bonnie++ -d ~/tmp/ -m apfs
Version  1.97       ------Sequential Output------ --Sequential Input- --Random-
Concurrency   1     -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine        Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP  /sec %CP
fs:apfs         32G   130  99 842978  82 769741  67  1424  99 870519  45  7153 296
Latency             81616us     417ms   22196us   20405us   96709us     102ms
Version  1.97       ------Sequential Create------ --------Random Create--------
fs:apfs             -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
                 16 17962  94 +++++ +++ 14766  96 19228  94 +++++ +++ 15020  97
Latency              7433us     200us    1199us     190us      73us     517us

 

bonnie apfs encrypted

Blackmagic Disk Speed Test

HFS+ encrypted

Blackmagic disk speed test hfs
 

APFS encrypted

Blackmagic disk speed test apfs

APFS vs HFS+?

There isn’t really a ‘versus’ here – it’s hard to fully compare two filesystems that were created 2 decades apart. While modern filesystems may have some disadvantages, they offer a whole bunch of new features and improvements that a normal user is even unaware of.
Older filesystems are fast – all of the widely used ones can saturate SATA hardware with no issues. But compared to modern ones, they offer next to no traits other than “you can store objects here”. Over time, additional layers of software improvements were added to some filesystems, but also new ones were created from scratch, with a variety of new and old, but now built-in capabilities. And while one can think that the later should be faster – it sometimes isn’t because of how things work. In short: faster doesn’t necessarily mean better and all of the above charts only show how fast (or slow) things are. If I were to compare NTFS to ReFS or EXT4 to ZFS, some new bottlenecks would also arise in specific workflows and specific hardware configurations.

Apple didn’t officially said much about APFS and most websites are just quoting Apple’s developer documentation: “Apple File System (…) features strong encryption, copy-on-write metadata, space sharing, cloning for files and directories, snapshots, fast directory sizing, atomic safe-save primitives, and improved file system fundamentals”.

I could speculate on why some tests shown a decreased performance but my knowledge on the subject is thin and that would just be some maybes and probablys (for example: I have no idea why encrypted HFS+ achieved better results than plain HFS+ in some tests but I repeated these tests with a comparable outcome) so instead, here are some observations:

  • in some cases APFS appears to be slightly slower than HFS+ when it comes to writing data, especially in smaller chunks
  • APFS appears to be a lot faster than HFS+ when it comes to reading data
  • AFPS’ built-in encryption shows decreased throughput speeds in comparison to HFS+ with FileVault2
  • seek rates seem a tiny bit higher with APFS but that would be unnoticable on most workflows
  • apart from speeds, APFS introduces a lot of under-the-hood improvements

And again, all these benchmarks were performed on a really fast NVMe SSD disk and even on this disk, the differences aren’t big. On SATA SSD there should’t be any visible problems with the filesystem upgrade.

 

 

APFS documentation

To learn about APFS advantages, check Apple File System Guide on developer.apple.com. Here’s a short features comparison:
APFS and HFS+ features

 

Thanks for reading!

 

< Page 1: dd, ioping, sysbench

 

Related:

How to upgrade macOS to High Sierra without filesystem change (HFS+ to APFS)
APFS and HFS+ benchmarks on 2017 MacBook Pro with macOS High Sierra beta (July 2017)

 

13 thoughts on “APFS vs HFS+: benchmarks on 2017 MacBook Pro with macOS High Sierra

  1. Thanks for writing this article! Been wondering how the file systems actually perform against each other. My first impression is that my Mac seems a little snappier, maybe because of the improved read speeds.

  2. Thanks for doing the legwork on this, it saves a lot of people a lot of time and some wouldn’t even know where to start on doing benchmarks like these. if nothing else, for me personally, this actually reinforces my interest in the new system. I’ve been researching which way to go while I’m getting all set up to install on High Sierra on Skylake with NvMe boot and a couple Samsung PM851’s in raid. I know how silly I am getting with wanting my drives to get every bit of mbps squeezed out of them, like I would really even notice the difference between 700 and 800 reads. But, that’s what makes this a hobby for some and work for others I guess. anyway………………….. sorry for the rant………. THANKS!!!!!

  3. I keep my 500GB music library on an external 1T spinning disk.

    iTunes has always been slow — when it became possible with the betas to format at disk with APFS, I formatted my music disk with APFS.

    iTunes became even more sluggish (unusably slow, much more than twice as slow), so I reverted to HFS+.

    . . .

    When High Sierra came out, I installed it on my late-2013 MB Pro (16G ram, 250G ssd). I kept it on through 10.13.1.

    After a couple of weeks it became obvious that my computer was sluggish (except for duplicating files).

    It was evident everywhere, but it was especially obvious when emuxing video files (almost twice as long).

    Remembering my experience with iTunes, I decided to reformat my HD as HFS+ and see if it made a difference.

    The computer did become much more responsive, so for now I am keeping my Macbook on HFS+.

  4. My MacBook Air (Early 2015) dropped write speeds to about 150MB/s but was very quick before installing High Sierra.
    Is the low powered CPU the bottleneck coding/compressing files to the SSD.

  5. Nice work but no one will be noticing the differences really, they just are too small either way. No one uses a setup like the tester did in a real world working environment. Other loaded apps and various background processes running take their toll on system performance.

  6. An issue I ran into with APFS encrypted is file corruption. Running MacBook Pro (late 2015). Even after 4 formats, and re-install (one done by tech at the Apple store), I always ended up with errors. Could not be repaired by tools, even in boot mode. Switched back to HFS+ and all is running smoothly. When at the Apple store they ran a diagnostics on my 1TB SSD and it passed with flying colors.

  7. Awesome. Thanks! On the other hand, a conclusion section would be handy. Have you tested the latest macOS versions?

    Note: this web form reports:
    Error: Time limit is exhausted. Please enter a CAPTCHA value again. Click the BACK button on your browser, and try again.

  8. Just wanted to say thanks and more importantly pointing out that while speed may be important but it’s not the complete picture. All of the benefits of a modern filing system, while may be milliseconds slower, you are getting benefits; A,B,C,D,E,F,G,etc… etc… I highly doubt that any “AVERAGE” human could be able to tell the speed difference but would see it if a drive crashes because it didn’t have X-feature.

  9. I think this isn’t comparing Apples to Apples as it were, when it comes to disk encryption — the encryption scheme in APFS is to my knowledge a lot stronger by default. I couldn’t find you saying what cipher suites you used for each.

  10. Upgraded early 2013 15″ MacBook Pro Retina 16GB/500GB to Mojave APFS encrypted, and Apple Mail (particularly smart mailboxes with over 100K messages) became dog slow — almost unusable. Then did a clean install same configuration — no difference. Then cloned drive to convert drive to HFS+ (no encryption), and same configuration became snappy again. Conclusion: APFS encrypted on this configuration is *not* a good choice (haven’t yet tried APFS unencrypted)

Leave a Reply