Live data from Hacker News

Time Machine and Mail: a match made in hell

rondam.blogspot.com

21–22 of 22 posts

Re: Time Machine and Mail: a match made in hell

#21
post #9

Earlier quoted context omitted.

That's pretty unscientific :-) To measure anything that fast reliably you have to do it more than once: [ron@mickey:~/foo]$ cat foo foo [ron@mickey:~/foo]$ time for i in {1..1000}; do cp foo foo.c.$i; done real 0m2.705s user 0m0.524s sys 0m2.190s [ron@mickey:~/foo]$ time for i in {1..1000}; do ln foo foo.l.$i; done real 0m2.618s user 0m0.486s sys 0m2.008s

Now you are measuring the speed of the fork/exec call. To really do this right you need to write a small script that copies the file 1000 times or creates a hard link 1000 times.

No, fork is a lot faster than disk I/O:

    [ron@mickey:~]$ time for i in {1..1000}; do echo foo>/dev/null; done
    real	0m0.064s
    user	0m0.039s
    sys	0m0.025s

Re: Time Machine and Mail: a match made in hell

#22
post #13

Earlier quoted context omitted.

Apple made the choice to have Time Machine operate with little CPU burden. I don't know why, given that my CPU is a sunk cost. (Also, I suspect that Apple chose hard links instead of deltas for ease of implementation, not to save CPU cycles.) last I checked, Venti didn't support recovering the space from deleted items, except by way of making a new copy of the file system. I think the state of the art has moved on si…

It was definitely not chosen for ease of implementation, as Apple had to modify core file system functionality, adding support for hard links to directories as well as files in HFS+ which is fraught with peril if not implemented just right. Users just don't want a backup utility to use any significant amount of CPU and slow down their machine.

As a side note, it has always been possible (on UFS at least) to link directories. It just gets a bit messy at fsck time, and older shells get a bit confused with 'cd ..'

Apple's implementation could have avoided linking directories - by creating new directories each time but always linking the files inside them - though I suspect that they decided it would be far quicker to replicate entire trees if you knew nothing in them had changed.

Post reply on HN