Possible compressdoc enhancement

dean talbot lists at dtxs.co.uk
Tue Sep 22 06:44:47 PDT 2009


dean talbot <lists at dtxs.co.uk> wrote:

> ...i think i found a couple of things that could shave a few
> cpu-cycles off of the BLFS 'compressdoc' script...

Update: I decided to test the modified script on a full system that i
could afford to trash...

# time compressdoc.orig -b -F /usr/share/man
  real	8m45.433s
  user	4m21.641s
  sys	4m19.278s

# time compressdoc.new -b -F /usr/share/man
  real	4m59.964s
  user	2m25.992s
  sys	2m29.770s

...This was on a system with 10,300 items under /usr/share/man, of
which 400 are hard-links (mostly from 'man-pages-posix'). So at face
value, it would appear that the original script ran "find <matching
inodes>" *9,900* times more often than it needed to!

I had to add the '-f' switch to "rm $SCRIPTSTART" to get it to run, but
the big difference comes entirely from using 'stat' to ID hard-links
(there was a negligible improvement with the timestamp included, too).

Hope this information is useful - and if it's flawed (besides being run
on a non-LFS system), i'd appreciate having my errors pointed out to me.

Dean



More information about the blfs-dev mailing list