Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Fredrik Gustafsson" <fredrik.gustafsson@axis.com>
To: Alex Stewart <alex.stewart@ni.com>,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Cc: tools-cfpbuild-internal <tools-cfpbuild-internal@axis.com>,
	"Alejandro Del Castillo" <alejandro.delcastillo@ni.com>
Subject: Re: [OE-core] Add package managers as a plugin
Date: Tue, 30 Jun 2020 18:38:14 +0000	[thread overview]
Message-ID: <1593542294400.41926@axis.com> (raw)
In-Reply-To: <541d697f-b45d-9416-fed9-d96dc65103e5@ni.com>

[-- Attachment #1: Type: text/plain, Size: 5072 bytes --]

Hi Alex,
Thanks for supplying a script!

I added apk to your script and then ran
```
for f in `ls`; do
printf "$f: "; cat $f | tail -2 | head -1 | awk -F ' ' '{print $3}' | sed -e 's/elapsed//'
done | sort
```

The result is here:
out.apk.1: 0:13.35
out.apk.2: 0:12.89
out.apk.3: 0:12.99
out.apk.4: 0:12.87
out.apk.5: 0:13.02
out.deb.1: 0:20.27
out.deb.2: 0:20.30
out.deb.3: 0:20.33
out.deb.4: 0:20.06
out.deb.5: 0:20.17
out.ipk.1: 0:18.51
out.ipk.2: 0:18.78
out.ipk.3: 0:18.80
out.ipk.4: 0:18.99
out.ipk.5: 0:18.97
out.rpm.1: 0:16.80
out.rpm.2: 0:16.83
out.rpm.3: 0:16.69
out.rpm.4: 0:16.78
out.rpm.5: 0:17.78

That is not supportive of my statement of ipk being the slowest package manager.
That statement come from timing tests done with our proprietary version of poky
that is somewhat extended when it comes to the do_rootfs task. We're generating
a bit more artifacts than poky. However apk is still ~22% faster than rpm and ~40%
faster than deb according to the data above.

So I tried your script with core-image-sato-sdk-ptest instead that is a bigger image.
The results where more mixed. There is a huge difference between different package
managers:
out.apk.1: 1:13.35
out.apk.2: 1:13.51
out.apk.3: 1:13.23
out.apk.4: 1:14.07
out.apk.5: 1:13.00
out.deb.1: 3:49.37
out.deb.2: 3:50.77
out.deb.3: 3:51.39
out.deb.4: 3:53.40
out.deb.5: 3:53.99
out.ipk.1: 2:38.99
out.ipk.2: 2:39.07
out.ipk.3: 2:35.34
out.ipk.4: 2:36.15
out.ipk.5: 2:34.55
out.rpm.1: 1:58.61
out.rpm.2: 1:59.42
out.rpm.3: 1:59.70
out.rpm.4: 1:58.96
out.rpm.5: 1:58.11

But yeah, I should probably rephrase my cover letter. You'll find a layer for APK that will
apply on top of my patch serie attached to this email.

Also note that there's a difference between the time to generate a package. Which 
we completely ignore in this measurements. It's not as important since it's being
cached, but for a fresh build it will be a difference between different package managers.

BR
Fredrik

___________________________
From: openembedded-core@lists.openembedded.org <openembedded-core@lists.openembedded.org> on behalf of Alex Stewart <alex.stewart@ni.com>
Sent: Wednesday, June 24, 2020 5:18 PM
To: Fredrik Gustafsson; openembedded-core@lists.openembedded.org
Cc: tools-cfpbuild-internal; Hugo Cedervall; Alejandro Del Castillo
Subject: Re: [OE-core] Add package managers as a plugin

On 6/23/20 6:13 AM, Fredrik Gustafsson wrote:
> When building and having a good cache hit, a significant amount of time is
> spent in the phase of generating a rootfs, which is really about the
> performance of the package manager. ipkg is way slower than deb or rpm.
I was interested enough in your comment here to collect a small sampling
of comparative do_rootfs runs on one of my dev machines.

I used a virgin poky clone and tried to replicate the steps you provided
in your OP, timing only the execution of `bitbake -c do_rootfs
core-image-minimal`. I used the debian `time` package for timing. Here's
what I got:

# Summary
PM     Avg do_rootfs time (s)
--     ----------------------
deb    33.89
ipk    33.35
rpm    31.85

# Raw Data
deb    00:33.54
deb    00:34.66
deb    00:33.55
deb    00:33.23
deb    00:34.46
ipk    00:33.96
ipk    00:34.43
ipk    00:33.99
ipk    00:32.17
ipk    00:32.22
rpm    00:29.92
rpm    00:32.31
rpm    00:31.90
rpm    00:33.31
rpm    00:31.80

Based on those results, it seems like all the current PMs are similar in
terms of execution time. Are there major differences between my test
setup and yours? And do you already have a layer with APK available that
I could compare against on my hardware?

This is the crude script I used to automate the test runs:

```
#!/bin/bash
set -euxo pipefail

TIME=/usr/bin/time

recipe=core-image-minimal

# Options are:
#  - 'package_deb' for debian style deb files
#  - 'package_ipk' for ipk files are used by opkg (a debian style
embedded package manager)
#  - 'package_rpm' for rpm style packages
function set_pkg_man() {
     pkg_man=${1}
     sed -i "s/\(^PACKAGE_CLASSES ?= \)\"\(.*\)\"/\1\"$pkg_man\"/"
conf/local.conf
}

function rebuild_recipe() {
     bitbake -c cleanall $recipe
     bitbake $recipe
}

function test_recipe() {
     local name=${1}
     bitbake -c cleansstate $recipe
     bitbake -c clean $recipe
     $TIME bitbake -c do_rootfs -f $recipe 2>&1 | tee outs/out.$name
}

# rpm
set_pkg_man package_rpm
rebuild_recipe

test_recipe rpm.1
test_recipe rpm.2
test_recipe rpm.3
test_recipe rpm.4
test_recipe rpm.5


# ipk
set_pkg_man package_ipk
rebuild_recipe

test_recipe ipk.1
test_recipe ipk.2
test_recipe ipk.3
test_recipe ipk.4
test_recipe ipk.5

# deb
set_pkg_man package_deb
rebuild_recipe

test_recipe deb.1
test_recipe deb.2
test_recipe deb.3
test_recipe deb.4
test_recipe deb.5
```

Thanks,

--
Alex Stewart
Software Engineer - LabVIEW Real-Time OS
National Instruments

alex.stewart@ni.com
office: +1(512)683-8522


[-- Attachment #2: meta-apk.tar.gz --]
[-- Type: application/gzip, Size: 31444 bytes --]

  reply	other threads:[~2020-06-30 18:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 11:13 Add package managers as a plugin Fredrik Gustafsson
2020-06-23 11:13 ` [PATCH 1/2] nopackages.bbclass: Move to nopackages_base.bbclass Fredrik Gustafsson
2020-06-23 11:41   ` [OE-core] " Richard Purdie
2020-06-23 11:13 ` [PATCH 2/2] lib/oe: Split package manager code to multiple files Fredrik Gustafsson
2020-06-23 12:02   ` [OE-core] " Richard Purdie
2020-06-23 12:12     ` Fredrik Gustafsson
2020-06-23 12:23       ` Paul Barker
2020-06-23 11:32 ` ✗ patchtest: failure for "nopackages.bbclass: Move to no..." and 1 more Patchwork
2020-06-23 18:50 ` [OE-core] Add package managers as a plugin Denys Dmytriyenko
2020-06-30 15:15   ` Fredrik Gustafsson
2020-06-24 15:18 ` Alex Stewart
2020-06-30 18:38   ` Fredrik Gustafsson [this message]
2020-06-30 20:22     ` Alex Stewart
  -- strict thread matches above, loose matches on Subject: below --
2020-06-25 10:13 Fredrik Gustafsson
2020-06-25 10:24 ` [OE-core] " Alexander Kanavin
2020-06-30 15:04   ` Fredrik Gustafsson
2020-06-30 15:43     ` Alexander Kanavin
2020-06-30 18:46       ` Fredrik Gustafsson
2020-06-26 10:52 ` Ross Burton
2020-06-27  4:59   ` Tim Orling
2020-06-30 15:36   ` Khem Raj
2020-06-30 19:01   ` Fredrik Gustafsson
2020-06-30 21:54     ` Martin Jansa
2020-06-30 22:12       ` Fredrik Gustafsson
2020-07-01 19:12         ` Alejandro del Castillo
2020-06-30 23:15       ` Andre McCurdy
2020-07-01  0:16         ` Martin Jansa
2020-06-25 10:21 Fredrik Gustafsson
2020-06-25 10:40 ` [OE-core] " Paul Barker
2020-06-30 18:39   ` Fredrik Gustafsson
2020-07-02 19:29 Fredrik Gustafsson
2020-07-02 20:28 ` [OE-core] " Paul Barker
2020-07-03 11:45   ` Fredrik Gustafsson

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=1593542294400.41926@axis.com \
    --to=fredrik.gustafsson@axis.com \
    --cc=alejandro.delcastillo@ni.com \
    --cc=alex.stewart@ni.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=tools-cfpbuild-internal@axis.com \
    /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