Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Trent Piepho <tpiepho@impinj.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] core/instrumentation: shave minutes off the build time
Date: Tue, 20 Mar 2018 21:47:37 +0000	[thread overview]
Message-ID: <1521582457.10662.196.camel@impinj.com> (raw)
In-Reply-To: <87o9jjltlh.fsf@dell.be.48ers.dk>

On Mon, 2018-03-19 at 21:04 +0100, Peter Korsgaard wrote:
>  >> After fixing s/L/l/, here are the timings for a 15 minute build:
>  >> 
>  >> configure                510.29
>  >> build                    166.12
>  >> extract                   45.53
>  >> other                     43.88
>  >> hostinstall               35.43
>  >> check_host_rpath          33.37
>  >> check_bin_arch            28.30
>  >> targetinstall             23.37
>  >> stageinstall              15.97
>  >> step_pkg_size              9.49
> 
>  > Thanks for those measurements. I still find it a bit annoying that we
>  > spend 1m10sec on instrumentation related topics on a 15 minutes build.
>  > The use of ccache makes the build time lower than it normally is, and
>  > therefore makes the instrumentation cost even more visible, but using
>  > ccache is a valid use case.

Those times were on a decently speced native Linux workstation.  For a
slightly different build in a dockerized container on a vsphere VM
acting as a agent for a Bamboo CI process, I get this timings from a
total build of 33 minutes:

configure                786.48
build                    656.64
step_pkg_size             94.67
extract                   90.29
other                     87.05
postimage                 47.90
check_host_rpath          47.21
hostinstall               42.22
targetinstall             35.36
check_bin_arch            31.01
stageinstall              30.38
finalize                  20.72
download                  19.33

All sources were already downloaded, so the download time can be mostly
 attributed to re-checking the file hashes.  ccache hit rate is > 99%,
yet build time really is that slow even with ccache.  High cost of
random I/O on a VM I think.  Instrumentation is a bit less than 10% of
total build time.

I'll also point out the interesting cost of step_pkg_size vs
hostinstall.  One would think running "find" over the host tree would
be much faster than copying all those files into the host tree in first
place.  Yet it's not!  Likely because the hostinstall step copies each
file once, while step_pkg_size must stat each file about 60 times, once
for each host package.

If one had per-package install trees, then most of these per-package
instrumentation steps could be much faster by operating only on the
package's files instead of all previous packages' files as well.

  reply	other threads:[~2018-03-20 21:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-15 20:35 [Buildroot] [PATCH 0/2] core/instrumentation: optimisations Yann E. MORIN
2018-03-15 20:35 ` [Buildroot] [PATCH 1/2] core/intrumetnation: don't spawn to get seconds-since-EPOCH Yann E. MORIN
2018-03-17 11:54   ` Cam Hutchison
2018-03-18 16:16     ` Yann E. MORIN
2018-03-19 16:15       ` Trent Piepho
2018-03-15 20:35 ` [Buildroot] [PATCH 2/2] core/instrumentation: shave minutes off the build time Yann E. MORIN
2018-03-18 14:14   ` Peter Korsgaard
2018-03-18 16:15     ` Yann E. MORIN
2018-03-18 16:33       ` Peter Korsgaard
2018-03-22 16:41         ` Thomas De Schampheleire
2018-03-22 16:50           ` Thomas Petazzoni
2018-03-22 17:11             ` Thomas De Schampheleire
2018-03-22 17:25               ` Trent Piepho
2018-03-22 22:39             ` Peter Korsgaard
2018-03-23 22:39           ` Arnout Vandecappelle
2018-03-23 23:03             ` Thomas Petazzoni
2018-03-19 16:30   ` Trent Piepho
2018-03-19 16:50     ` Thomas Petazzoni
2018-03-19 20:04       ` Peter Korsgaard
2018-03-20 21:47         ` Trent Piepho [this message]
2018-03-19 16:53     ` Peter Korsgaard

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=1521582457.10662.196.camel@impinj.com \
    --to=tpiepho@impinj.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