Re: [PATCH] diff-delta: produce optimal pack data
From: Nicolas Pitre <hidden>
Date: 2016-06-15 22:42:20
On Fri, 24 Feb 2006, Linus Torvalds wrote:
The other thing to look at is "max_size": right now it initializes that to "size / 2 - 20", which just says that we don't ever want a delta that is larger than about half the result (plus the 20 byte overhead for pointing to the thing we delta against). Again, if you feel that normal compression compresses better than half, you could try changing that to .. max_size = size / 4 - 20; ..
Like I mentioned, max_size should also be caped with the deflated undeltified object size. This value is easy to get since plain objects are already deflated.
NOTE! Every SINGLE one of those heuristics are just totally made up by yours truly, and have no testing behind them. They're more of the type "that sounds about right" than "this is how it must be". As mentioned, Nico has already been playing with the heuristics - but he wanted better packs, not better CPU usage, so he went the other way from what you would want to try..
Actually it's a good balance I'm after. Using 30% more CPU for 10% smaller packs is OK I'd say. Using 100 times the CPU for 50% saving on only one particular delta is not acceptable. And using more than one hour for 200MB of data with the current window default is not acceptable either. Nicolas