What Happened to APFS Fast Directory Sizing?
Has anyone successfully enabled Fast Directory Sizing on a directory on an APFS volume in macOS and then confirmed that it works using
dirstat_np
?
That’s one of those promised features I was referring to that never really was hooked up or implemented right. IIRC, the problems with it are:
- You have to create the directory and set an attribute on it before putting anything in it. It’s not available on already existing directories.
- The size returned only includes the files data fork space. Extended attributes (including the resource fork) are not included.
- The API is synchronous with no progress callbacks.
Those reasons keep the Finder from using it, and the Finder team asked for that APFS feature.
Is it a limitation of APFS that this feature couldn’t be created in a way that was useful to the Finder team, or is it just not a priority perhaps? I do find APFS fascinating. Also curious why the delta snapshot sending that was demoed never amounted to anything?
And Radar 32794924 apparently says that, if even you’re OK with those limitations, the DIRSTAT_FAST_ONLY
path currently doesn’t work, so the API can only do the DIRSTAT_FORCE_FALLBACK
path of recursively calculating all the sizes.
Previously:
- APFS in 2018
- Apple File System Reference
- Pondering the Conversion From HFS+ to APFS
- Apple File System (APFS)
Update (2025-01-16): Kory Heard:
Apple strongly hinted that APFS would be open sourced when first announced but that never came.
See also: Hacker News.