automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: make clean is slow


From: Ralf Wildenhues
Subject: Re: make clean is slow
Date: Sat, 21 Aug 2010 11:15:14 +0200
User-agent: Mutt/1.5.20 (2010-04-22)

So long ago already ...

* Bob Friesenhahn wrote on Wed, Oct 21, 2009 at 10:26:14PM CEST:
> On Wed, 21 Oct 2009, Ralf Wildenhues wrote:
> >>Is there a way to make this quite a lot faster?
> >
> >The LTLIBRARIES bits: yes, noted.  The PROGRAMS bits should be
> >reasonably fast already, only forking a constant number of times.
> 
> While clean is running, it is clear that the libraries bit is taking
> most of the time.  My package has quite a lot of these files to
> remove, and the sequential nature of the removal process causes it
> to be rather slow.
> 
> The time to clean my package depends quite a lot on the OS:
> 
> FreeBSD:                              1.512
> OS-X Leopard:                         3.575
> Solaris 10:                           4.339
> Linux (under Solaris VirtualBox):     4.299
> MinGW:                                        6.656
> 
> For some of the OSs the time is about the same if the directory is
> already cleaned, while for others (e.g. OS-X) the time improves
> considerably if the directory is already clean.

Here's a first patch I'm merging to master.  It speeds up removal of the
"so_locations" files, getting me 30% faster 'make clean' overall with
your package.

It is not the whole story: object files are still cleaned in a slow way.
For another patch.

Cheers,
Ralf

    Speed up removal of auxiliary linker output files for ltlibraries.
    
    * lib/am/ltlib.am (clean-%DIR%LTLIBRARIES): Rewrite using just
    one `rm' invocation.
    Report by Bob Friesenhahn.

diff --git a/lib/am/ltlib.am b/lib/am/ltlib.am
index 29aa00c..55e53e1 100644
--- a/lib/am/ltlib.am
+++ b/lib/am/ltlib.am
@@ -104,9 +104,11 @@ clean-%DIR%LTLIBRARIES:
 ## `so_locations' files are created by some linkers (IRIX, OSF) when
 ## building a shared object.  Libtool places these files in the
 ## directory where the shared object is created.
-       @list='$(%DIR%_LTLIBRARIES)'; for p in $$list; do \
-         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
-         test "$$dir" != "$$p" || dir=.; \
-         echo "rm -f \"$${dir}/so_locations\""; \
-         rm -f "$${dir}/so_locations"; \
-       done
+       @list='$(%DIR%_LTLIBRARIES)'; \
+       locs=`for p in $$list; do echo $$p; done | \
+             sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
+             sort -u`; \
+       test -z "$$locs" || { \
+         echo rm -f $${locs}; \
+         rm -f $${locs}; \
+       }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]