[jump to content][No Software Patents]Tools (new) : cmpfast [ Home | Scylla+Charybdis old home | Tools (old) | Tools (new) | FAQ | Downloads ]

Scylla and Charybdis cmpfast - Tools

The tools are developed under Linux with ESR's paradigm release early, release often in mind.
So you can consider this beta software, or alpha, or pre-alpha, or even worse ;)

Have a look in the download directory for all downloads.
As always here, all you get is the source. No binaries here.

cmpfast 0.2.2-20081020-030200

Fast compare two files binary (look into latest version, download latest version 0.2.2-20081020-030200, sig)

This is just a binary compare for two files.

Why another program as cmp does the job?

cmp is not very fast when you read two files from the same hard drive. The problem is called "thrashing", as the read heads of the hard drive are moving wildly on the surface and effective read speed drops very low.

cmpfast reads files in bigger blocks (by default 1 MB), thus reducing thrashing a lot. It also switches sides to double the continuously read blocks, thus speeding up fastcmp again. On modern fast hard drives you still hear a thrashing sound, this is because you still have 30 to 40 head movements per second to compare 30 MB or more per second. It would be not easy to go below this number, as it then needs a highly filesystem optimized low level access which is unlikely to be possible. So even cmpfast is very simple it's not easy to speed up more, even not if you raise the compare buffer size. 1 MB should be a good size for all possibilities.

Cmpfast has following "standard" return values now:
* 0 (true) if everything ok (compares equal)
* 1 for usage etc.
* 10 if files differ in contents
* 101 if EOF on first file
* 102 if EOF on second file
* other return values (probably 255) on misc errors (like missing files)

History:

version 0.2.2-20081020-030200

download (227107 bytes) sig

O_DIRECT now skipped on filesystems lacking O_DIRECT support.

If open() fails with O_DIRECT, it is retried without. Some filesystems (like FUSE) apparently do not support O_DIRECT.

version 0.2.1-20081020-012928

download (227007 bytes) sig

O_DIRECT for open() lessens buffer cache impact

Another speedup fix: With O_DIRECT the kernel hopefully uses no buffer cache for the data, which lessens the memory pressure of cmpfast. On some systems it might be that this slows down the performance of cmpfast itself, however then it reduces overall system load, which is desireable.

version 0.2.0-20080513-175041

download (211105 bytes) sig

Better scriptable return values

version 0.1.0-20080423-055959

download (210292 bytes) sig

Option -v added to show progress

version 0.0.1-20070926-051223

download (190608 bytes)

Minor bug removed: Now cmpfast uses less memory in most cases.

Also version of tinolib was updated.

[view more history][view complete history]

License and Disclaimer

All you can see here is free software according to the GNU GPL.
Copyright (C)2000-2008 by Valentin Hilbig
Note that the software comes with absolutely no warranty of any kind.
You use the software at your own risk.
Valentin Hilbig cannot be hold responsible for any unintended damage,
lost data or malfunction of the software you can find here.

[FSFE contributor 2007]

[end of page - jump back to content][hacker culture]
Last modified: 2008-12-27 by Valentin Hilbig [ Imprint / Impressum ]