News for hackers. Stuff that matters.
Re:Think twice before encrypting your HFS+ volumes on High S... by Osiris on Monday October 02, 2017 @11:51AM (#15384774)
Another reason is that read/write speeds on APFS encrypted volumes are 30-40% slower than non-encrypted volumes[1].

[1] https://news.ycombinator.com/item?id=15333036

Re:Think twice before encrypting your HFS+ volumes on High S... by bouke on Monday October 02, 2017 @02:26PM (#15386433)
As the speed test was using a beta of High Sierra / APFS, I performed some tests of my own. I've written /dev/zero to the disk, and read Xcode_9_GM_seed.xip from the disk using different block sizes using `dd`. I ran the read tests a few times, as there was a lot variation in the results. I've excluded the first result of the read results for each FS. The test was run on a Samsung Evo Pro 850 500GB SSD inside a Sharkoon USB-C case connected over USB-C to a MacBook Pro 2016 w/ Touchbar.

    Speed in MB/s
                HFS+    HFS+ Encrypted  APFS        APFS Encrypted
    1M write    498     473             490  (-2%)  444 (-6%)
    1M read     6896    6815            6860 (-1%)  6827 (0%)
    4k write    486     477             485  (-0%)  445 (-7%)
    4k read     2734    2709            2599 (-5%)  2545 (-6%)
While there is still some performance degradation between HFS+ and APFS, it's within a single digit now.
Re:Think twice before encrypting your HFS+ volumes on High S... by bouke on Monday October 02, 2017 @05:32PM (#15388146)
Following the comments on the test method, I've run the 'Blackmagic Disk Speed Test'. The results are the following.

    Speed in MB/s
            HFS+    HFS+ Encrypted  APFS    APFS Encrypted
    read    513     513             508     506
    write   477     460             478     432
The earlier results of 7 GB/s are quite impossible with the Samsung Evo Pro 850 -- those max out around 500 MB/s. So my earlier test results are invalid. The new test results mostly show that both file systems can saturate the disk's raw throughput.

-- update

On my internal Apple SSD (PCI-Express) I've created a partition for testing. I've kept "Blackmagic Disk Speed Test" running for a few minutes and took an average of the tests. The results are in favor of APFS, beating HFS+ by 3-17% in throughput.

    Speed in MB/s
            HFS+    HFS+ Encrypted  APFS        APFS Encrypted
    read    2400    2240            2700 (+13%) 2400 (+7%)
    write   1900    1930            2000 (+5%)  1980 (+3%)
Re:Think twice before encrypting your HFS+ volumes on High S... by stirner on Monday October 02, 2017 @03:45PM (#15387277)
dd is not an acceptable benchmark. You need to eliminate the effects of buffering/caching to get accurate results.
Re:Think twice before encrypting your HFS+ volumes on High S... by Someone1234 on Monday October 02, 2017 @04:25PM (#15387607)
/dev/zero is also not an acceptable source of data; since \0\0\0\0\etc is unnaturally easy to compress. A large real file (e.g. installation ISO) may have been a better idea.
Re:Think twice before encrypting your HFS+ volumes on High S... by nrki on Monday October 02, 2017 @11:52AM (#15384779)

  Speed in MB/s
             HFS+     HFS+ Encrypted  APFS     APFS Encrypted
  1M WRITE   1375     1373            1372     933
  1M READ    2446     2340            2162     1304
  4K WRITE   852      797             502      378
  4K READ    2106     1486            2156     1001

https://news.ycombinator.com/item?id=15333754
Re:Think twice before encrypting your HFS+ volumes on High S... by zitterbewegung on Monday October 02, 2017 @12:26PM (#15385205)
This was high sierra beta though.
Re:Think twice before encrypting your HFS+ volumes on High S... by mikeash on Monday October 02, 2017 @12:05PM (#15384932)
That's really strange. Why would encryption affect APFS so badly but not HFS+?
Re:Think twice before encrypting your HFS+ volumes on High S... by convivialdingo on Monday October 02, 2017 @12:44PM (#15385393)
Lots of reasons.

If crypto is part of the syscall path, then you definitely pay with latency. If you can push IO to a worker thread then you can release the user call faster. This also requires tuning the read-ahead cache more aggressively.

It could also be a change in crypto algorithm, unaligned page IO, or any other overlooked IO latency problems.

Re:Think twice before encrypting your HFS+ volumes on High S... by j45 on Monday October 02, 2017 @03:56PM (#15387366)
At a high level, I believe APFS encrypts files individually (and uniquely) instead of the whole drive. Have to do some more reading :)
Re:Think twice before encrypting your HFS+ volumes on High S... by Someone on Monday October 02, 2017 @04:26PM (#15387611)
Not instead of, but optionally in addition to (https://developer.apple.com/library/content/documentation/Fi...)

On Mac OS, it seems you only get full disk encryption, though (https://arstechnica.com/gadgets/2017/09/macos-10-13-high-sie...)

Re:Think twice before encrypting your HFS+ volumes on High S... by j45 on Monday October 02, 2017 @05:23PM (#15388083)
Appreciate the clarification. Both are better than just one.
Re:Think twice before encrypting your HFS+ volumes on High S... by timcederman on Monday October 02, 2017 @05:31PM (#15388133)
Just tested this. Was consistently getting 2000mb/s+ writes before, now getting ~1600mb/s. Reads are inconsistent, but most results are also 20-40% slower than before.
Re:Think twice before encrypting your HFS+ volumes on High S... by ringaroundthetx on Monday October 02, 2017 @02:05PM (#15386255)
Just curious, at these speeds, what use case would really affect you, or people you can imagine?

30-40% in a stress test is significant. but if I'm not editing 4k videos perhaps, where would I notice this?

Even amongst us programmers who use horrible inefficient IDEs and make horrible inefficient electron apps, disk speed isn't really a noticeable bottleneck right now?

Even a convoluted local environment to simulate a server environment with a ton of microservices wouldn't really be affected much by this

Re:Think twice before encrypting your HFS+ volumes on High S... by finnh on Monday October 02, 2017 @02:21PM (#15386392)
Disk speed is always a bottleneck, much more than CPU generally. Almost every thing you do leads to, or is dependent on, IO speeds. If you disk speed drops by 40%, for example, every application will be at least 40% slower to load. That's a major hit. That horribly inefficient electron app is now slow to load, not just slow to run.

Or, to put this another way: Do you have an SSD? Why?

Re:Think twice before encrypting your HFS+ volumes on High S... by frou_dh on Monday October 02, 2017 @03:40PM (#15387230)
The filesystem is cached in RAM so it’s too simplistic to talk about applications like that.
Re:Think twice before encrypting your HFS+ volumes on High S... by ringaroundthetx on Monday October 02, 2017 @03:49PM (#15387311)
yeah, not always true, and this is more about noticeable performance. The answer is to why I have an SSD is speed and throughput and the point of calling this file system change out is because there are diminishing returns to the productivity in real world use

a benchmark is just a repeated process which is not reflective or real world use except in very small narrowly tailored applications