Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Oct 2015 08:22:34 +0100
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        soralx@cydem.org
Cc:        ports@FreeBSD.ORG
Subject:   Re: Speedup ports install
Message-ID:  <20151028072233.GM17025@ivaldir.etoilebsd.net>
In-Reply-To: <20151027220549.2bb7a660@sol>
References:  <20151027220549.2bb7a660@sol>

next in thread | previous in thread | raw e-mail | index | archive | help

--EOHJn1TVIJfeVXv2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Tue, Oct 27, 2015 at 10:05:49PM -0700, soralx@cydem.org wrote:
>=20
> Howdy!
>=20
>  I have a suggestion: to significantly speedup the packaging phase
>  when installing ports, pass '-f tgz' flag to `pkg create`:
>    --- Mk/bsd.commands.mk  (revision 400371)
>    +++ Mk/bsd.commands.mk  (working copy)
>    @@ -126,7 +126,7 @@
>     PKG_DELETE?=3D           ${PKG_BIN} delete -y
>     PKG_INFO?=3D             ${PKG_BIN} info -g
>     PKG_VERSION?=3D          ${PKG_BIN} version
>    -PKG_CREATE?=3D           ${PKG_BIN} create
>    +PKG_CREATE?=3D           ${PKG_BIN} create -f tgz
>     PKG_ADD?=3D              ${PKG_BIN} add
>     PKG_QUERY?=3D            ${PKG_BIN} query
>=20
>  This way, gzip will be used instead of default xz (which
>  is very slow). The extra compression of xz is not needed,
>  as the package file will be deleted shortly anyway.
>=20
>  Same idea applies to portmaster. Change=20
>    pkg_create=3D"pkg create "
>  to
>    pkg_create=3D"pkg create -f tgz "
>  on line 1916 of 'portmaster' script.
>=20
>  Ports install a lot faster this way, even on a machine with a fast CPU
>  (especially noticeable when doing portupgrade with lots of small ports).
>=20
>  Example. [root@soralx /usr/ports/science/paraview]# time make package
>   With xz:
>     =3D=3D=3D>  Building package for paraview-4.3.1_1
>      real    1m41.120s
>      user    1m40.070s
>      sys     0m1.089s
>   With gzip:
>     =3D=3D=3D>  Building package for paraview-4.3.1_1
>      real    0m15.931s
>      user    0m15.010s
>      sys     0m0.925s
>  Note that `make package` will still produce xz-compressed file after
>  the flag is added to "PKG_CREATE"; I changed the behaviour only for
>  this example, to demonstrate the time difference (factor of ~6.7).
>=20

When installing a port there is no packaging phase. pkg register which is u=
sed
during make install uses the stage directory "as an archive" directly so th=
ere
is no compression at all.

portupgrade/portmaster is another storry, IIRC portmaster only creates pack=
ages
as backup of the installed version just in case the new package will fail i=
t can
reinstall the old one in that case, yes a tgz would be way faster, you can =
even
chose plain tar to even more reduce the over head. for portupgrade I do not
remember what it does. Note that the backup thing of portmaster could now
possibly be removed since the ports tree support staging because now the po=
rts
tree checks that everything is ok before installing on the system, but that
would require even more refactoring.

Bapt

--EOHJn1TVIJfeVXv2
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlYwd7kACgkQ8kTtMUmk6Exr5wCdGcwoY1XD1uIAiI6IzV9PubKp
bvkAn0kAc1aK27Ncc6/NrwEKAd08zw3H
=wnzA
-----END PGP SIGNATURE-----

--EOHJn1TVIJfeVXv2--



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