Merge lp:~chipaca/snappy/copyfile into lp:~snappy-dev/snappy/snappy-moved-to-github
Proposed by
John Lenton
Status: | Merged |
---|---|
Approved by: | Sergio Schvezov |
Approved revision: | 440 |
Merged at revision: | 438 |
Proposed branch: | lp:~chipaca/snappy/copyfile |
Merge into: | lp:~snappy-dev/snappy/snappy-moved-to-github |
Diff against target: |
505 lines (+385/-50) 8 files modified
helpers/cp.go (+91/-0) helpers/cp_linux.go (+46/-0) helpers/cp_linux_test.go (+44/-0) helpers/cp_other.go (+30/-0) helpers/cp_test.go (+169/-0) policy/policy.go (+3/-28) policy/policy_test.go (+1/-1) snappy/build.go (+1/-21) |
To merge this branch: | bzr merge lp:~chipaca/snappy/copyfile |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Sergio Schvezov | Approve | ||
John Lenton (community) | Abstain | ||
Review via email: mp+258078@code.launchpad.net |
Commit message
Moved two implementations of Copy into helpers with the linux implementation being based on sendfile.
Description of the change
Moved two implementations of Copy into helpers.
Because I was having fun, also implemented copy using sendfile when in linux.
Using sendfile avoids at least two copies over read/write; more if copying multiple chunks of data (currently golang's io does chunks of 32k).
On the bbb, copying a 10M file using io.Copy takes .79s/.03s/.26s (real/user/sys); doing it using sendfile uses .64s/.01s/.13s (averaged over 10 runs).
This requires a kernel newer than 2.6.33, which should not be a problem.
To post a comment you must log in.
Moving to WIP, because I kinda forgot all about permissions.