configure: speed up print_enabled_components()
authorAvi Halachmi (:avih) <avihpit@yahoo.com>
Mon, 30 Jul 2018 19:48:04 +0000 (22:48 +0300)
committerJames Almer <jamrial@gmail.com>
Mon, 8 Oct 2018 23:56:02 +0000 (20:56 -0300)
commitdf6e929e89340c2dbb316868c798fce516a2cf79
tree0dd79d338bfff590b4f4d8be040fdd49840d61ff
parent42355d12dbfd92b11fa6c28858ea041bcf94bd7b
configure: speed up print_enabled_components()

x4 - x10 faster.

Inside print_enabled components, the filter_list case invokes sed
about 350 times to parse the same source file and extract different
info for each arg. This is never instant, and on systems where fork is
slow (notably MSYS2/Cygwin on windows) it takes many seconds.

Change it to use sed once on the source file and set env vars with the
parse results, then use these results inside the loop.

Additionally, the cases of indev_list and outdev_list are very
infrequent, but nevertheless they're faster, and arguably cleaner, with
shell parameter substitutions than with command substitutions.

Tested-by: Michael Niedermayer <michael@niedermayer.cc>
Tested-by: Helmut K. C. Tessarek <tessarek@evermeet.cx>
Tested-by: Dave Yeo <daveryeo@telus.net>
Tested-by: Reino Wijnsma <rwijnsma@xs4all.nl>
Signed-off-by: James Almer <jamrial@gmail.com>
(cherry picked from commit 923586a58f37deedeb01f742e4804bc36736a6bc)
configure