[FFmpeg-devel] [PATCH] Speedup make removing implicit rules for makefiles and dependencies (cure for slow "make" in MSYS+MinGW)

Måns Rullgård mans
Wed Oct 28 02:41:07 CET 2009


Ramiro Polla <ramiro.polla at gmail.com> writes:

> Hi,
>
> On Tue, Oct 27, 2009 at 8:28 PM, Adam Strzelecki <ono at java.pl> wrote:
>> Lately I was obliged to make sure one of my multiplatform projects using
>> FFmpeg compiles well on MinGW. Then I found out the "make" takes AGES in
>> MSYS+MinGW. All because "include *.dep" causes implicit rules on .d files
>> (checkout "make -d"), while file testing on UNIX is pretty cheap, it's not
>> in Windoze.
>> So here's a cure that really speeds up "make" in Windoze, and of course on
>> other systems, however the speed up not so significant on UNIX.
>> (1) Puts all dependency files to .PHONY, which cancels implicit rules
>> (2) Define empty rules for Makefile, common.mak, subdir.mak & config.mak
>> that cancels implicit rules also for those files
>> (3) Define empty rules for .svn/entries & version.sh... as above
>
> Like Mans said, this certainly won't go into FFmpeg SVN.
>
> But I was curious of this speedup, so I tried it. Building the entire
> tree with previously ccached objects gave no measurable speedup for
> "make", "make -r", and your patch (all went about 4.2 minutes). All
> deviations were inside stddev. This might be because this was running
> under VirtualBox. Building a tree that was already entirely built (so
> only make was run and it didn't compile anything) I got no speedup
> with your patch but "make -r" made the time go from 19s to 2s.
>
> Adam, what speedup did you measure and how?
>
> Mans, is it safe to run "make -r"? If so I'll probably add it to the
> FATE boxes.

It should be.  If it finishes without error, there should be no way it
could have gone wrong.  AFAIK, we do no rely on any builtin rules.
I'd disable them in the makefiles if a directive equivalent to -r
existed, but I can't find such a thing.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-devel mailing list