From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [RFC 0/3] Speeding up the Makefile parsing
Date: Sun, 23 Mar 2014 21:57:28 +0100 [thread overview]
Message-ID: <20140323215728.081c2c90@skate> (raw)
In-Reply-To: <874n2oveed.fsf@dell.be.48ers.dk>
Dear Peter Korsgaard,
On Sun, 23 Mar 2014 21:38:50 +0100, Peter Korsgaard wrote:
> >>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
>
> > Hello,
> > The current strategy of Buildroot with regard to .mk files is to
> > always include all of them. However, with an ever-increasing number of
> > packages, the number of .mk files to parse is growing significantly,
> > and this makes the execution of any trivial make target take at least
> > 12 seconds on a relatively fast SSD equipped laptop. For example, a
> > simple thing like "make help" or "make external-deps" takes 12 seconds
> > solely because of the parsing time of more than a thousand of package
> > makefiles.
>
> .. and how fast is it after this series?
Before the series:
$ time make help
[...]
real 0m15.760s
user 0m14.818s
sys 0m0.969s
After the series:
$ time make help
[...]
real 0m1.209s
user 0m0.807s
sys 0m0.416s
> > The proposed RFC solution is to look at the BR2_PACKAGE_<foo>
> > variables, and from them derive the name of the package .mk files to
> > be included. It is a simple change in the main Makefile, but it has
> > two major consequences that we need to discuss on whether they are
> > acceptable or not:
>
> > * We need to have BR2_PACKAGE_HOST_<foo> options for *all* host
> > packages. Of course, the vast majority of them can be blind
> > options, but it means that we have to ensure all the host packages
> > are properly selected at the Config.in level. That's a fairly
> > significant change.
>
> I don't think this is too bad. Maybe we could look into generating the
> _DEPENDENCIES line from depends/select statements in the Config.in
> automatically, then we only need to explicitly handle the optional
> dependencies in the .mk file (or decide to also handle them in Kconfig
> if possible).
Why not, but doing this would require a pre-processing step to process
the Config.in file and generates the makefile dependencies from it.
Also, having the mandatory dependencies handled automatically but not
the optional dependencies seems a bit weird, no?
That being said, doing for host packages what we do today for target
packages doesn't that horrible, especially since we don't have all the
crazy dependencies on toolchain options that are complicated to handle
for target packages.
> > * Since the logic assume that BR2_PACKAGE_FOO is always
> > package/foo/foo.mk, it means we have to 1/ guarantee that the
> > package option name matches the package file name, and 2/ guarantee
> > that we don't use any sub-directories to store packages.
>
> The 2nd part is more serious as we use subdirs today to group related
> packages and have supported them "forever". We also used to tell people
> (before BR2_EXTERNAL) to put their own packages under package/<company>.
>
> I guess playing tricks with $(wildcard) to find the .mk file is going to
> add quite some performance overhead.
Yes. This part is more problematic, and I don't have a good solution
for it.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
next prev parent reply other threads:[~2014-03-23 20:57 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-23 17:42 [Buildroot] [RFC 0/3] Speeding up the Makefile parsing Thomas Petazzoni
2014-03-23 17:43 ` [Buildroot] [RFC 1/3] pkg-utils: introduce a make-based LOWERCASE function Thomas Petazzoni
2014-03-25 21:47 ` Arnout Vandecappelle
2014-03-23 17:43 ` [Buildroot] [RFC 2/3] Makefile: include only the package .mk files that are needed Thomas Petazzoni
2014-03-23 17:43 ` [Buildroot] [RFC 3/3] package: add a few needed host options for a few packages Thomas Petazzoni
2014-03-25 22:06 ` Arnout Vandecappelle
2014-03-23 20:38 ` [Buildroot] [RFC 0/3] Speeding up the Makefile parsing Peter Korsgaard
2014-03-23 20:57 ` Thomas Petazzoni [this message]
2014-03-25 21:03 ` Arnout Vandecappelle
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=20140323215728.081c2c90@skate \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox