Re: Check if files equal
- Posted by kbochert at ix.netcom.com Jul 07, 2002
- 439 views
-------Phoenix-Boundary-07081998- You wrote on 7/7/02 5:53:05 PM: > >Files are not databases, they are .zip .avi and .mp3 files mainly (stuff >coming down from satellite) - so they are compressed in some way. >Speed is more important than accuracy. > >Tone Skoda > Some thoughts: 1) Compare long words rather than words or bytes. 2) Reduce disk latency. If possible, read one file entirely into memory before starting. If not possible, fill most of memory with one file, then read comparitively small chunks of the other. 3) It may be useful to use non-blocking calls to the read routine so you can compare one buffer while reading the next. More importantly, this may prevent the disk from having to do a full rotation between reads. 4) Have the two files on different disks! 5) Have the two files on four disks! 6) You could use assembly for the comparison routines, and optimize for the processors' multiple execution units, but that is likely to be swamped by disk traffic. 7) Inside knowledge of the format might allow comparison of just a CRCC. Karl Bochert -------Phoenix-Boundary-07081998---