Repository navigation
Introduce copy_uncompressed_file, for direct copy - #81
afbjorklund wants to merge 1 commit into
Conversation
|
I like the idea but not the code duplication. :) Have you checked whether copy_uncompressed_file is measurably faster than copy_file for uncompressed files? Is the potential speedup worth the extra maintenance cost, albeit small? |
|
Yes and no. It was faster (for the actual file copy), but it didn't make much difference. Basically I just wanted a version without the gzip complexity, especially when adding more compressions to the mix. To make it really go faster, you would have to resort to a lot of non-portable tricks. And even then you would have to have pretty large files. But some things like preallocating (ftrunc) can be very useful. See https://github.com/itensionanders/ccache/tree/uncompressed-fast for the stuff involved ? The new lz4f was at afbjorklund@06d1081#diff-6d7e72ea1ca2b7d0258e568a155084bd Another use case was compressed->compressed copy, like done in the "external" branch... |
For copying compressed files etc, fall back to the original copy version.
|
Oops, turned out that I missed some error handling when "translating" from gzio to stdio... |
df3d9ae to
1142b6a
Compare
Which means? :) |
|
You could get silent read errors, updated the branch with those checks added though. Think the test build failed due to a timeout, actually. |
|
OK, but what does it mean from a pull request point of view? Should I drop it? |
|
I think the name of the new function is awful, so it could probably need some more thought... But what I wanted to accomplish compared to copy_file was:
It coukd definitely need some tests and benchmarks written, either way. |
|
Regarding ef2c268: I tried out |
|
I think this code will show up at other places if needed, and the "fast" track really wasn't. |
For copying compressed files etc, fall back to the original copy version.
(this is mostly a refactoring, for future features and also optimizations)