[patch] pkg_delete(1) speedup

Pav Lucistnik pav at FreeBSD.org
Mon Mar 31 02:26:35 PDT 2008


soralx at cydem.org píše v ne 30. 03. 2008 v 23:49 -0700:

> Notice pkg_info in ^T output during "Checking if x11/rxvt-unicode already
> installed" phase. This one takes awhile. The actual command is:
> `/usr/sbin/pkg_info -q -O x11/rxvt-unicode`
>  real    0m37.697s
>  user    0m0.125s
>  sys     0m0.360s
> 
> find_pkgs_by_origin() in info/perform.c uses the same matchbyorigin()
> in lib/match.c. What's interesting here, however, is that simple
> `time grep ORIGIN /var/db/pkg/*/+CONTENTS` takes ~7 sec (XXX re-test on
> that same notebook XXX), while find_pkgs_by_origin() incarnation of
> practically the same functionality takes over 30 sec.

Possibly the overhead from plist_cmd()/read_plist() functions.
It seems to "interpret" the whole +CONTENTS file instead of just looking
for "ORIGIN" string.

> BTW, I have a feeling that the "Registering installation" should be made
> more verbose. It takes more time that anything else now, and one's left
> to wonder what exactly is going on (seems like quite a few different
> things).

See pkg-dep target in bsd.port.mk. I bet the biggest timeslice goes into
that "for dep" loop.

> Also, I found that during the "Checking if <*> already installed" step,
> 'mtree' (XXX find out exact command here XXX) is called (from bsd.port.mk?),
> which can be skipped by setting NO_MTREE. What effect does [not] calling
> mtree have?

It's actually install-mtree target, which happen to be silent.
It creates a tree of directories that are assumed to exist
(like /usr/local/bin, /usr/local/lib, ...). If you skip it, some ports
may fail to install because those directories are not present.

-- 
Pav Lucistnik <pav at oook.cz>
              <pav at FreeBSD.org>

The Novice rogue. A rather shifty individual
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: Toto je =?UTF-8?Q?digit=C3=A1ln=C4=9B?=
	=?ISO-8859-1?Q?_podepsan=E1?= =?UTF-8?Q?_=C4=8D=C3=A1st?=
	=?ISO-8859-1?Q?_zpr=E1vy?=
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20080331/cc3084fb/attachment.pgp


More information about the freebsd-ports mailing list