]> git.ipfire.org Git - thirdparty/automake.git/commit
[ng] dist: optimize calculation of list of distributed file
authorStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 4 May 2012 00:26:30 +0000 (02:26 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Fri, 11 May 2012 11:18:18 +0000 (13:18 +0200)
commita44fd52927c1e25b0572154004fb6455b93bf0e6
treebeb3cf6a0513e0ee9972d1ea6721e79b9af645f9
parentc62b42b64c588c98d9b1f370d208056e82b39d8b
[ng] dist: optimize calculation of list of distributed file

Our implementation of the $(am__uniq) make function is slow as
hell when applied to big lists.  Since that function is used to
(re)calculate the list of distributed files, its inefficiency
reflects on *every* run of a Makefile generated by Automake which
distributes a lot of files.  For example, a null build of the
Automake tree now takes 20 seconds (!) on my Debian system, while
earlier it was practically instantaneous (less than half a second).

Luckily, the GNU make manual documents that the $(sort) built-in
also strip duplicates from the sorted list.  Since we don't care
about the order of the distributed files (or directories thereof),
we can use $(sort ...) instead of $(call am__uniq, ...), and live
happily.

* lib/am/distdir.am (am__dist_files)_: Uniqify content using
'$(sort)', not '$(am__uniq)'.
(am__dist_parent_dirs): Likewise.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/distdir.am