Skip to content
Snippets Groups Projects
Commit 45499e55 authored by Avi Halachmi (:avih)'s avatar Avi Halachmi (:avih) Committed by James Almer
Browse files

configure: speed up check_deps()


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: default avatarMichael Niedermayer <michael@niedermayer.cc>
Tested-by: default avatarHelmut K. C. Tessarek <tessarek@evermeet.cx>
Tested-by: default avatarDave Yeo <daveryeo@telus.net>
Tested-by: default avatarReino Wijnsma <rwijnsma@xs4all.nl>
Signed-off-by: default avatarJames Almer <jamrial@gmail.com>
parent 923586a5
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment