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

configure: speed up flatten_extralibs_wrapper()


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: 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 d91370e0
No related branches found
No related tags found
No related merge requests found
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