[FFmpeg-devel] [RFC] New build system

Tomas Härdin tjoppen at acc.umu.se
Mon Jun 18 17:36:23 EEST 2018


tor 2018-06-14 klockan 17:03 +0100 skrev Josh de Kock:
> Any comments, and thoughts on a new build system would be much 
> appreciated including concerns regarding it.

Others have mentioned this already, but it bears repeating: the build
(make) isn't what's so slow, configure is. I went ahead and did some
profiling on it based on the StackOverflow thread that pops up when one
Web-searches "bash profiling" [1]. I went with what the second guy in
there says, because the first method eventually invokes the OOM killer.

Running configure with this timing method generates about 350 MiB of
data. Pasting, sorting and cutting line lengths down to 80 chars
yields  205 MiB, ~4M lines:

./pastem.sh sample-time.3099 > xxpasted
sort -r -n xxpasted | cut -c -80 > xxsorted

The top of the result looks like this, for a ./configure with a wall
time of 7 minutes(!):

> 1529328268.431696969    + LC_ALL=C
>  0.409855126    + enable makeinfo
>  0.363928815    ++ echo
>  0.311682872    + append CXXFLAGS -std=c++11
>  0.269393447    + '[' 06 -ge 5 ']'
>  0.138258064    + enable pod2man
>  0.106506505    +++++ case 'hq_hqa_decoder_extralibs' in
>  0.096331014    + enable ebp_available
>  0.088183898    + enabled cross_compile
>  0.088088085    ++ echo -I/usr/include/alsa
>  0.076656112    ++ dep_any_level=1
>  0.072606939    + for func in $COMPLEX_FUNCS
>  0.068691315    + enable snd_pcm_htimestamp
>  0.067642785    ++ echo
>  0.055935755    + enable flt_lim
>  0.055764002    +++ echo
>  0.055377041    + enable const_nan
>  0.053997618    +++ echo
>  0.053772963    +++ echo
>  0.053206037    +++ echo
>  0.052331662    +++ echo
>  0.051481411    +++ echo
>  0.049535905    +++ echo
>  0.048992642    +++ echo
>  0.048822862    + enable getopt
>  0.048404893    ++ echo
>  0.047455682    +++ echo
>  0.047416869    +++ echo
>  0.047386485    ++ echo -pthread
>  0.047302549    + add_ldflags -Wl,-rpath-
link=libpostproc:libswresample:libswscale:
>  0.047291743    + enable_sanitized 'struct addrinfo'
>  0.047267974    +++ echo
>  0.047259671    +++ echo
>  0.047095523    +++ echo
>  0.047060081    + check_func getopt
>  0.046771877    +++ echo
>  0.046585371    +++ echo
>  0.046355111    +++ echo
>  0.046201711    +++ echo
>  0.045938850    +++ echo
>  0.045876554    +++ echo

Most of the file is crap like this.

enable() and append() are just doing the equivalent of adding to lists
and hashes. This is slower than it needs to be partly because configure
doesn't make use of some useful bashisms (I guess to maintain BSD
compat?)

I'm in favor of something changing, because the current slowness is
simply not acceptable. Messing around when adding a new codec or format
and having to wait *seven minutes* between attempts when something is
wrong is a serious motivation killer..

Can't say much about Meson, but CMake+Ninja has been fast enough for my
needs for a long time.

/Tomas

[1] https://stackoverflow.com/questions/5014823/how-to-profile-a-bash-s
hell-script-slow-startup


More information about the ffmpeg-devel mailing list