conserve icon indicating copy to clipboard operation
conserve copied to clipboard

Don't try to compress incompressible files

Open sourcefrog opened this issue 8 years ago • 4 comments

Probably look at the extension or filename pattern (eg to handle git packs).

Might be simplest to compress them at level 0.

sourcefrog avatar Dec 06 '16 05:12 sourcefrog

Maybe also change paths inside conserve so they can be more easily matched by a glob.

sourcefrog avatar Dec 21 '16 16:12 sourcefrog

This also would still be useful, but Snappy seems sufficiently smart about incompressible data it's not a priority.

sourcefrog avatar Oct 15 '17 20:10 sourcefrog

Furthermore, Snappy (or at least snappy-rs) has no option for 0 compression.

We could potentially store them just exactly as-is, but I think there's actually some benefit in storing content not exactly as-is, so that it's not accidentally confused with the origin files. In any case, Snappy compression speed doesn't seem to be the bottleneck.

sourcefrog avatar Jan 09 '20 01:01 sourcefrog

I feel like heuristics based purely on file name or extension might be a bit fragile.

Maybe also add a predicate of the files being smaller than certain size to be eligible for consideration for being stored as is? I.e. always try to compress files larger than, say, 50MB, regardless of file name pattern or extension.

darrenldl avatar Jan 09 '20 02:01 darrenldl