Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Oct 2015 17:26:22 +1100
From:      Kubilay Kocak <koobs@FreeBSD.org>
To:        soralx@cydem.org, ports@FreeBSD.ORG
Subject:   Re: Speedup ports install
Message-ID:  <56306A8E.3070009@FreeBSD.org>
In-Reply-To: <20151027220549.2bb7a660@sol>
References:  <20151027220549.2bb7a660@sol>

next in thread | previous in thread | raw e-mail | index | archive | help
On 28/10/2015 4:05 PM, soralx@cydem.org wrote:
> 
> Howdy!
> 
>  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?=           ${PKG_BIN} delete -y
>     PKG_INFO?=             ${PKG_BIN} info -g
>     PKG_VERSION?=          ${PKG_BIN} version
>    -PKG_CREATE?=           ${PKG_BIN} create
>    +PKG_CREATE?=           ${PKG_BIN} create -f tgz
>     PKG_ADD?=              ${PKG_BIN} add
>     PKG_QUERY?=            ${PKG_BIN} query
> 
>  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.
> 
>  Same idea applies to portmaster. Change 
>    pkg_create="pkg create "
>  to
>    pkg_create="pkg create -f tgz "
>  on line 1916 of 'portmaster' script.
> 
>  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).
> 
>  Example. [root@soralx /usr/ports/science/paraview]# time make package
>   With xz:
>     ===>  Building package for paraview-4.3.1_1
>      real    1m41.120s
>      user    1m40.070s
>      sys     0m1.089s
>   With gzip:
>     ===>  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).
> 

I would recommend creating a Bugzilla issue for this under the 'Ports &
Packages' Product, "Ports Framework" Component. It will be automatically
assigned to portmgr@ who can make a call on this proposal.

I'd also suggest commenting the entry (in your patch) so that its clear
why its being done. Something like:

# Use tgz (over xz) here for better installation performance

Nice work!

./koobs



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