jmacd / xdelta

open-source binary diff, delta/differential compression tools, VCDIFF/RFC 3284 delta compression
http://xdelta.org
1.1k stars 184 forks source link

Decoding thousands of diff files - best way? #215

Open HQX755 opened 8 years ago

HQX755 commented 8 years ago

Hello, I'm afraid I can't find any benchmarks or suggestions for how to get the most efficient implementation for my needs.

I have a diff file amount in range of 1 - 8000 and I want to quickly patch the source files. Is there any special method to quickly decode little files and rather bigger files? What I do is creating some threads for decoding, but they seem to be useless, as my disk I/O is the only thing that is under fire. CPU usage when decoding bigger files: 10% (dual core, 4 threads), smaller files: 20% This is nothing and I'm wondering if there is any faster way to figure out if a source file is already patched or not patchable with a diff, as it takes quite some time for xd3 to notice the checksum mismatch.

I'm not using mapped files and I read the files in a loop with a maximum of 512*32 bytes on each blk sequence request. On output I write directly to the file instead of allocating huge buffers. I have the diff allocated on memory.

For 4000 files (size varies between 10b - 100 Mb, but averagely 0,5-1mb) I need 15-20min. Is this good for ~20 mb (15mb read) disk i/o activity?