• Avi Halachmi (:avih)'s avatar
    configure: speed up check_deps() · 45499e55
    Avi Halachmi (:avih) authored
    x4 - x25 faster.
    
    check_deps() recursively enables/disables components, and its loop is
    iterated nearly 6000 times. It's particularly slow in bash - currently
    consuming more than 50% of configure runtime, and about 20% with other
    shells.
    
    This commit applies few local optimizations, most effective first:
    - Use $1 $2 ... instead of pushvar/popvar, and same at enable_deep*
    - Abort early in one notable case - empty deps, to avoid costly no-op.
    - Smaller changes which do add up:
      - Handle ${cfg}_checking locally instead of via enable[d]/disable
      - ${cfg}_checking: test done before inprogress - x2 faster in 50%+
      - one eval instead of several at the empty-deps early abort path.
    
    - The "actual work" part is unmodified - just its surroundings.
    
    Biggest speedups (relative and absolute) are observed with bash.
    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>
    45499e55
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...