|
|
|
|
|
by pyre
5485 days ago
|
|
Why are hard-links to directories that much faster? It seems like creating a bunch of actual directories with hard-linked files in them is a trivial difference. They still need to scan the files to figure out what has changed, and that's where the really time sink is, no? |
|
For small amounts of files I agree with you that the hard linked directories would make a trivial difference. Keep in mind that by default Time Machine backs up /usr, /Applications and /System along with your user data which is quite a lot of files in the end.
That's all just creating the new backup's directory tree. The new data copying itself is fast because Time Machine uses the FSEvents API (which is like inotify but more suitable for backing up) so that it knows exactly what it has to back up beforehand (no scanning). If your computer crashes or you switch disks or otherwise screw up your FSEvents DB then it does have to scan the whole disk looking for changes and that can take hours.
So technically it is fast because it uses FSEvents and also because it can hard link directories. If either of those things are missing then the process would be significantly slower.