All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Fredrik Gustafsson" <fredrik.gustafsson@axis.com>
To: Martin Jansa <martin.jansa@gmail.com>
Cc: Ross Burton <ross@burtonini.com>,
	OE-core <openembedded-core@lists.openembedded.org>,
	tools-cfpbuild-internal <tools-cfpbuild-internal@axis.com>
Subject: Re: [OE-core] Add package managers as a plugin
Date: Tue, 30 Jun 2020 22:12:54 +0000	[thread overview]
Message-ID: <1593555173884.3272@axis.com> (raw)
In-Reply-To: <20200630215424.u77jq5frrnpwztfc@jama>

Hi Martin,
apk is quite different compared to other package managers. A traditional package manager download a package, saves it to a local cache, verifies it and then extract it. That's at least 3 reads and 2 writes of the data. Apk does this on the fly, so 1 read and 1 write of the data. I believe that it's a so fundamental design choice that opkg would have it very hard to compete for speed. The speed advantage is even bigger when installing over network since the extraction and verification is done wile the network is waiting for data. That means that apk has usually installed the package when an ordinary package manager just has downloaded it and should start to verify and install it.

So there's no secret sauce or awesome optimizations, it's "just" an other architectural design.

With that said, there's still some low hanging fruit for apk, for example package generation (my patch is doing 2 reads and 2 writes of all data) and index generation (duplicate reads and one extraction too much) that could have significant speedup. But let's make it possible to use apk at all before starting to tune it.

More information:
https://www.youtube.com/watch?v=sIG2P9k6EjA


BR
Fredrik
________________________________________
From: Martin Jansa <martin.jansa@gmail.com>
Sent: Tuesday, June 30, 2020 11:54 PM
To: Fredrik Gustafsson
Cc: Ross Burton; OE-core; tools-cfpbuild-internal
Subject: Re: [OE-core] Add package managers as a plugin

On Tue, Jun 30, 2020 at 07:01:23PM +0000, Fredrik Gustafsson wrote:
> Hi Ross,
> those 5 seconds will increase to minutes for my use case and we build a lot
> hence I hope this will save us a lot of computer power and engineering time.
> For example I've sent numbers on building a bigger image (core-image-sato-sdk-ptest)
> to Alex and Alex:
> 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
>
> Also consider that if we've a target without python with limited space, rpm is out
> of the question. So the real comparison would be between ipk and apk. Let's
> say we can save 80 seconds in each build. Now multiply that with the number of
> builds, and we do a lot (I guess we might approach 100 000 builds/week in the
> next year). Then this will save 92.5 days build time each week.

This is impressive.

Have you tried to profile where opkg spends most of the time compared to
apk? It would be nice to know if there is something fundamentally
different in how they handle packages or if apk is just better
optimized.

Now with opkg better maintained (thanks Alejandro!) there might be some
relatively low hanging optimalizations which could be implemented there
as well (for people who didn't implement the rest to switch to apk yet
:)).

I know at LGE we have some patches (some related to performance as well) which
unfortunately weren't ever upstreamed :/, some are at:
https://github.com/webosose/meta-webosose/tree/master/meta-webos/recipes-devtools/opkg/opkg

Cheers,

  reply	other threads:[~2020-06-30 22:13 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25 10:13 Add package managers as a plugin 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 [this message]
2020-07-01 19:12         ` Alejandro del Castillo
2020-06-30 23:15       ` Andre McCurdy
2020-07-01  0:16         ` Martin Jansa
  -- strict thread matches above, loose matches on Subject: below --
2020-07-02 19:29 Fredrik Gustafsson
2020-07-02 20:28 ` [OE-core] " Paul Barker
2020-07-03 11:45   ` Fredrik Gustafsson
2020-06-25 10:21 Fredrik Gustafsson
2020-06-25 10:40 ` [OE-core] " Paul Barker
2020-06-30 18:39   ` Fredrik Gustafsson
2020-06-23 11:13 Fredrik Gustafsson
2020-06-23 18:50 ` [OE-core] " Denys Dmytriyenko
2020-06-30 15:15   ` Fredrik Gustafsson
2020-06-24 15:18 ` Alex Stewart
2020-06-30 18:38   ` Fredrik Gustafsson
2020-06-30 20:22     ` Alex Stewart

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=1593555173884.3272@axis.com \
    --to=fredrik.gustafsson@axis.com \
    --cc=martin.jansa@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=ross@burtonini.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.