Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: Michael Niedermayer <michael@niedermayer.cc>
To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org>
Subject: Re: [FFmpeg-devel] [PATCH 00/13] [RFC] Reduce unnecessary recompilation
Date: Mon, 14 Mar 2022 15:23:26 +0100
Message-ID: <20220314142326.GA2829255@pb2> (raw)
In-Reply-To: <ef52bcf-9852-6e47-cbc-f4b59e9654e@martin.st>


[-- Attachment #1.1: Type: text/plain, Size: 3480 bytes --]

On Fri, Mar 11, 2022 at 02:17:42PM +0200, Martin Storsjö wrote:
> On Wed, 23 Feb 2022, Martin Storsjö wrote:
> 
> > When updating the ffmpeg source, one quite often ends up in a situation
> > where practically all of the codebase (or all of a library) gets rebuilt,
> > due to updates to headers that are included in most files.
> > 
> > In some cases, full rebuilds are warranted of course, but they could also
> > be avoided in many cases - e.g. such as if the minor/micro version of
> > a library has been bumped, or if a new component (codec, demuxer, filter
> > etc) has been enabled (or removed if reconfiguring with an older source
> > version). Very few source files are affected by exactly what the full
> > library version is, or by the full list of enabled components.
> > 
> > To avoid such rebuilds, I've got a proof of concept patchset that
> > splits headers, so that most source files avoid including the bits that
> > change often and that shouldn't affect how they are built.
> > 
> > - The version.h headers are split into a separate version_major.h which
> >  contains only the major library version, and accompanying FF_API_*
> >  defines. The main library headers only include version_major.h, and
> >  files that need the exact version (e.g. LIB<name>_VERSION* or
> >  LIB<name>_IDENT) can include version.h explicitly. This is a minor
> >  break of the public API though, as definitions that used to be available
> >  no longer are.
> > 
> >  This works mostly fine for most libraries, but there's little point in
> >  splitting libavutil/version.h, because LIBAVUTIL_VERSION_INT is used
> >  in every source file that defines an AVClass.
> > 
> >  By splitting version.h, and update to the minor/micro version numbers
> >  of all libraries except avutil now would require recompiling 30
> >  files instead of 1653 before.
> > 
> >  (This change also should lower the barrier to and reduce the risk of
> >  forgetting to bump the version numbers, which one otherwise often
> >  postpones while working on a patch, as it forces rebuilds.)
> > 
> > - config.h is split into a separate config_components.h that includes the
> >  list of enabled/disabled components (corresponding to $ALL_COMPONENTS
> >  in configure). One could consider splitting up config.h even more, but
> >  that probably gives less benefit compared to the amount of churn.
> > 
> >  Surprisingly, a nontrivial number of source files do depend on the
> >  state of specific encoders/decoders/components, so quite a few files
> >  do end up requiring including config_components.h. (Also this change
> >  can possibly break compilation of source files that require external
> >  dependencies that I haven't tested.)
> > 
> >  In practice, this reduces the number of rebuilt source files from
> >  1979 to 193, if there's a change to the list of enabled components
> >  but not to the rest of config.h.
> > 
> > What do you think - is it worth the slight churn to avoid pointless
> > rebuilds?
> 
> Ping - I never got any feedback on the general concept of this patchset; is
> either of the refactorings worthwhile?

I think its a good idea. Faster rebuilds & tests are always desirable

thx


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Freedom in capitalist society always remains about the same as it was in
ancient Greek republics: Freedom for slave owners. -- Vladimir Lenin

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

[-- Attachment #2: Type: text/plain, Size: 251 bytes --]

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

  parent reply	other threads:[~2022-03-14 14:28 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-23 14:29 Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 01/13] libavutil: Remove leftover uses of version.h Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 02/13] libavcodec: Remove unnecessary includes " Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 03/13] libavformat: " Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 04/13] libavdevice: " Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 05/13] libavcodec: Split version.h Martin Storsjö
2022-02-25 14:34   ` Michael Niedermayer
2022-02-25 14:38     ` Martin Storsjö
2022-02-25 20:23       ` Andreas Rheinhardt
2022-02-25 20:44         ` Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 06/13] libavformat: " Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 07/13] libavdevice: " Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 08/13] libpostproc: " Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 09/13] libswresample: " Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 10/13] libswscale: " Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 11/13] libavfilter: " Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 12/13] doc: Add an entry to APIchanges about no longer implicitly including version.h Martin Storsjö
2022-02-23 14:29 ` [FFmpeg-devel] [PATCH 13/13] configure: Use a separate config_components.h header for $ALL_COMPONENTS Martin Storsjö
2022-02-24 21:22   ` Michael Niedermayer
2022-02-24 21:35     ` Martin Storsjö
2022-03-11 12:17 ` [FFmpeg-devel] [PATCH 00/13] [RFC] Reduce unnecessary recompilation Martin Storsjö
2022-03-13 21:04   ` Paul B Mahol
2022-03-14 14:23   ` Michael Niedermayer [this message]
2022-03-16 12:16     ` Martin Storsjö

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220314142326.GA2829255@pb2 \
    --to=michael@niedermayer.cc \
    --cc=ffmpeg-devel@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git