Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Aug 2012 21:17:12 +0100
From:      Matthew Seaman <matthew@FreeBSD.org>
To:        freebsd-ports@FreeBSD.org
Subject:   Re: pkgng default schedule... registering a few reasons for rethinking the final implementation...
Message-ID:  <50368FC8.9080906@FreeBSD.org>
In-Reply-To: <50368973.5040202@pcbsd.org>
References:  <1345739186.30848.YahooMailClassic@web111307.mail.gq1.yahoo.com> <50365F37.7040601@pcbsd.org> <CADLFttcOfBvH6rpyjTQrV12mRBCy1VKDbJJ0aYZW1bLm154v4Q@mail.gmail.com> <50368973.5040202@pcbsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigFDD2160CEA73FC7C0DA0331C
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 23/08/2012 20:50, Kris Moore wrote:
> Well, it was about time I got to doing a benchmark of this anyway :)
>=20
> I did quick benchmark of how one of our utilities parses through a list=

> of 1k packages on a newer i5 system:
>=20
> First test, using /var/db/pkg/<pkg> check we have been doing:
>=20
> 0.178s 0:00.31 54.8%
> 0.123s 0:00.26 61.5%
> 0.099s 0:00.15 60.0%
> =20
> Second test, using "pkg info <pkg>":
>=20
> 5.347s 0:11.41 91.7%=20
> 5.444s 0:11.52 91.3%
> 5.878s 0:11.32 91.4%
>=20
> The pkg info command is quite a bit slower in this case, but 5 seconds
> isn't horrible.
>=20
> Now I ran the same benchmark on a slower 1.66gz Atom system, checking
> about 1200~ packages:
>=20
> First test, using /var/db/pkg/<pkg> check we have been doing:
>=20
> 0.604s 0:00.76 86.8%
> 0.622s 0:00.77 84.4%
> 0.614s 0:00.73 90.4%
> =20
> Second test, using "pkg info <pkg>":
>=20
> 28.507s 0:54.80 99.1%
> 28.282s 0:54.60 99.4%
> 28.302s 0:54.52 99.4%
>=20
> Now this is what concerns me a bit. It took closer to 30 seconds, which=

> is quite a while to wait, especially if a utility like ours has to run
> these checks when it starts up, to show the user whats installed / not
> installed on the system.
>=20
> The only way around It I've found is to do a quick "pkg info" on the
> entire DB, dump that to a list, then begin to grep through that list fo=
r
> each item, but it still takes 10~ seconds on the atom. That may be what=

> I end up having to do, but it still stinks to go from a half a second
> startup, to 10 seconds each time. Any other ideas on how to do this
> faster with the new pkgng?

Doing one big pkg query in bulk is going to be faster than sequentially
querying for one package at a time.  Sqlite startup time is significant,
and probably relatively more so on slower hardware.

What data are you trying to extract from pkg info?  Did you try using
pkg query instead?  (pkg query does much the same as pkg info, but is
more oriented towards scripting.)


--=20
Dr Matthew J Seaman MA, D.Phil.
PGP: http://www.infracaninophile.co.uk/pgpkey



--------------enigFDD2160CEA73FC7C0DA0331C
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.16 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlA2j9AACgkQ8Mjk52CukIyyDQCcC7zBrQSmxGXDU+I6XTTGP3bY
p2oAnRhp2aKN46qtJxhRVQk1hapSxoj6
=0Vp+
-----END PGP SIGNATURE-----

--------------enigFDD2160CEA73FC7C0DA0331C--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?50368FC8.9080906>