• Avi Halachmi (:avih)'s avatar
    configure: speed up flatten_extralibs_wrapper() · 58b81ac6
    Avi Halachmi (:avih) authored
    x50 - x200 faster.
    
    Currently configure spends 50-70% of its runtime inside a single
    function: flatten_extralibs[_wrapper] - which does string processing.
    
    During its run, nearly 20K command substitutions (subshells) are used,
    including its callees unique() and resolve(), which is the reason
    for its lengthy run.
    
    This commit avoids all subshells during its execution, speeding it up
    by about two orders of magnitude, and reducing the overall configure
    runtime by 50-70% .
    
    resolve() is rewritten to avoid subshells, and in unique() and
    flatten_extralibs() we "inline" the filter[_out] functionality.
    
    Note that logically, "unique" functionality has more than one possible
    output (depending on which of the recurring items is kept). As it
    turns out, other parts expect the last recurring item to be kept
    (which was the original behavior of uniqie()). This patch preservs
    its output order.
    Tested-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
    Tested-by: 's avatarHelmut K. C. Tessarek <tessarek@evermeet.cx>
    Tested-by: 's avatarDave Yeo <daveryeo@telus.net>
    Tested-by: 's avatarReino Wijnsma <rwijnsma@xs4all.nl>
    Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
    58b81ac6
Name
Last commit
Last update
compat Loading commit data...
doc Loading commit data...
ffbuild Loading commit data...
fftools Loading commit data...
libavcodec Loading commit data...
libavdevice Loading commit data...
libavfilter Loading commit data...
libavformat Loading commit data...
libavresample Loading commit data...
libavutil Loading commit data...
libpostproc Loading commit data...
libswresample Loading commit data...
libswscale Loading commit data...
presets Loading commit data...
tests Loading commit data...
tools Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CONTRIBUTING.md Loading commit data...
COPYING.GPLv2 Loading commit data...
COPYING.GPLv3 Loading commit data...
COPYING.LGPLv2.1 Loading commit data...
COPYING.LGPLv3 Loading commit data...
CREDITS Loading commit data...
Changelog Loading commit data...
INSTALL.md Loading commit data...
LICENSE.md Loading commit data...
MAINTAINERS Loading commit data...
Makefile Loading commit data...
README.md Loading commit data...
RELEASE Loading commit data...
configure Loading commit data...