attic icon indicating copy to clipboard operation
attic copied to clipboard

Optimization: asynchronous writeback

Open sourcejedi opened this issue 10 years ago • 1 comments

fsync() after each segment write is suboptimal :). It means you stop (cpu) processing to wait for the physical disk write. And the default segment size is 5MB. (I noticed bup avoids this issue by writing pack files of 1GB by default :).

Improvements will vary depending disk/cpu speed. (I guess the worst case was when they were evenly matched).

  • Writing 65M on SheevaPlug "NAS" went from 47s to 45s.
  • 920M on desktop HDD (read from SSD) went from 68s to 45s

sourcejedi avatar Aug 12 '15 10:08 sourcejedi

Obviously there's a few lines of code here, but it's not intrusive. I tried to keep it as simple as possible.

It's still slightly clever, but there's no point using python if you're not going to pass a few closures between threads :).

sourcejedi avatar Aug 12 '15 12:08 sourcejedi