[1/1] cmake-native: Set --parallel for configure

Submitted by Robert Yang on Dec. 19, 2018, 6:51 a.m. | Patch ID: 157307

Details

Message ID f8c21c17d3ad2ca31c4b26b23b74ab0bdefd2c77.1545202218.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

Robert Yang Dec. 19, 2018, 6:51 a.m.
This can save do_configure's time from 330s to 60s on my host.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 meta/recipes-devtools/cmake/cmake-native_3.12.2.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/meta/recipes-devtools/cmake/cmake-native_3.12.2.bb b/meta/recipes-devtools/cmake/cmake-native_3.12.2.bb
index 9a1390f..71b3326 100644
--- a/meta/recipes-devtools/cmake/cmake-native_3.12.2.bb
+++ b/meta/recipes-devtools/cmake/cmake-native_3.12.2.bb
@@ -27,7 +27,9 @@  CMAKE_EXTRACONF = "\
 "
 
 do_configure () {
-	${S}/configure --verbose --prefix=${prefix} -- ${CMAKE_EXTRACONF}
+	${S}/configure --verbose --prefix=${prefix} \
+		--parallel=${@d.getVar('PARALLEL_MAKE').replace('-j ', '')} \
+		-- ${CMAKE_EXTRACONF}
 }
 
 do_compile() {

Comments

Ross Burton Dec. 19, 2018, 10:37 a.m.
On Wed, 19 Dec 2018 at 06:34, Robert Yang <liezhi.yang@windriver.com> wrote:
> +               --parallel=${@d.getVar('PARALLEL_MAKE').replace('-j ', '')} \

See oe.utils.parallel_make_argument()

Ross
Robert Yang Dec. 20, 2018, 6:50 a.m.
On 12/19/18 6:37 PM, Burton, Ross wrote:
> On Wed, 19 Dec 2018 at 06:34, Robert Yang <liezhi.yang@windriver.com> wrote:
>> +               --parallel=${@d.getVar('PARALLEL_MAKE').replace('-j ', '')} \
> 
> See oe.utils.parallel_make_argument()

Thanks, updated in the repo:

commit 19ac4e33e66353581191e7dfd866f6c0f73eafa6
Author: Robert Yang <liezhi.yang@windriver.com>
Date:   Tue Dec 18 17:48:22 2018 +0800

     cmake-native: Set --parallel for configure

     This can save do_configure's time from 330s to 60s on my host.

     Signed-off-by: Robert Yang <liezhi.yang@windriver.com>



// Robert

> 
> Ross
>
Ross Burton Dec. 20, 2018, 12:16 p.m.
On Thu, 20 Dec 2018 at 06:46, Robert Yang <liezhi.yang@windriver.com> wrote:
> +               --parallel="${@oe.utils.parallel_make_argument(d, '%d')}" \

Tweaked when merging to mut to be:

+       ${S}/configure --verbose --prefix=${prefix} \
+               ${@oe.utils.parallel_make_argument(d, '--parallel=%d')} \
+               -- ${CMAKE_EXTRACONF}

I see similar wins here, walltime for cmake-native's build goes from
five minutes to one minute.

(!!!)

Ross
Ross Burton Dec. 20, 2018, 12:22 p.m.
On Thu, 20 Dec 2018 at 12:16, Burton, Ross <ross.burton@intel.com> wrote:
> I see similar wins here, walltime for cmake-native's build goes from
> five minutes to one minute.

For anyone playing along at home, this is what I did:

Cleaned tmp, applied patch to the mut branch.

$ git checkout HEAD^; bitbake cmake-native -C unpack
$ git checkout mut ; bitbake cmake-native -C unpack

Force a full build of cmake-native for both commits.

Then use buildstats-diff to compare the runs:

$ buildstats-diff /data/poky-tmp/master/buildstats/*
  PKG             TASK          ABSDIFF  RELDIFF  CPUTIME1 -> CPUTIME2
  cmake-native    do_configure    29.1s   +11.0%    265.7s -> 294.8s

Cumulative cputime:
  18.0s    +2.2%    13:41.4 (821.4s) -> 13:59.3 (839.3s)

Oh, that's odd: it took *more* time to run.  But the output from my
bitbake clearly showed bitbake taking five minutes before and one
minute after.

Oh, *walltime* not *cputime*.

$ buildstats-diff /data/poky-tmp/master/buildstats/* --diff-attr walltime
  PKG             TASK          ABSDIFF  RELDIFF  WALLTIME1 -> WALLTIME2
  cmake-native    do_configure  -214.6s   -82.4%     260.4s -> 45.8s

Cumulative walltime:
  -218.4s    -72.3%    05:02.1 (302.1s) -> 01:23.7 (83.7s)

cputime is generally a more useful metric during a build, but for
isolated tests like this walltime is also relevant. This is
demonstrating that the same work is happening, but in parallel.

Ross