On 2010-05-11 23:53+0100 Andrew Ross wrote: > Alan's idea of using cmp may be more efficient on > Linux. I've not tried timing it. Not copying large files around must be > more efficient. Is cmp widely available on non-Linux platforms? I suspect > diff / tail are more common. > > The main reason I used diff / tail was just because that was what I always > did by hand before I wrote the test_diff.sh script.
Hi Andrew: My preliminary tests indicated using cmp gave a noticeable (but not enormous) speedup on Linux so I have configured test_diff.sh(.in) to use that if available (strictly for Linux because the -i option which is used appears to be a GNU extension). See revision 10991. If all PostScript files are built prior to the comparison, I find there is roughly a factor of 1.6 speedup when running the test_diff_psc target due to this change from tail and diff to cmp. BTW, I think this factor is made up almost entirely from cmp being faster than diff for files that are cached in memory (i.e., when timed the second time for the command where it is assumed the first time caches all relevant files in memory if they are not too large.) I also got a factor of 1.4 speedup of cmp compared to diff for two identical files that were cached in memory. The files being copied for tail and diff are presumably all being cached in memory as well (at least on Linux). That is, the tail reads the PostScript file into memory, stores results without output in memory, then the diff accesses that in-memory file, then on to the next PostScript file.... Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); PLplot scientific plotting software package (plplot.org); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ ------------------------------------------------------------------------------ _______________________________________________ Plplot-devel mailing list Plplot-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/plplot-devel