From owner-freebsd-ports@freebsd.org Wed Oct 28 06:26:31 2015 Return-Path: Delivered-To: freebsd-ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 82EF1A20A0D for ; Wed, 28 Oct 2015 06:26:31 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 6126D1B6D for ; Wed, 28 Oct 2015 06:26:31 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 5DDFFA20A0C; Wed, 28 Oct 2015 06:26:31 +0000 (UTC) Delivered-To: ports@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44434A20A0B for ; Wed, 28 Oct 2015 06:26:31 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: from mail-pa0-x235.google.com (mail-pa0-x235.google.com [IPv6:2607:f8b0:400e:c03::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0A8DD1B6C for ; Wed, 28 Oct 2015 06:26:31 +0000 (UTC) (envelope-from koobs.freebsd@gmail.com) Received: by pasz6 with SMTP id z6so246652431pas.2 for ; Tue, 27 Oct 2015 23:26:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:reply-to:subject:references:to:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=tMAnm1TUBCmIngpGOGwD6FMq70qYJshUtk0+b6oNftc=; b=c4CJarCeujLbDmYlDlr/2I7VAaA3IHoY1ZaPjLlV0owNCeAsLtF7/6aK7Jr3U9HhCI 6PwpUrrpe+cLewSPqg65Jx42XNmRNPVqrmubb4vtLfa2ak+erQI4aDrHGBQYInXEk09a 5gPtWZccO4I/QrP8o0p5j+Wku3sSmwzRt75AvRxuVfswFD9eot7Rb6HbMx6ZY7/V8SLp L6yb3LbP76GfdUx8SFEv5F4e67o08u/lyubXrc5rqRUxFq/48D/HdfmiA4nw6i7DF+A+ IhpsWn6HV27k2UKlkK363dOEOa+P9hgO+1fpWup88ONkPkYRaSrDsgvpDylnyu5YWBaW +iNw== X-Received: by 10.68.225.66 with SMTP id ri2mr32325382pbc.59.1446013590429; Tue, 27 Oct 2015 23:26:30 -0700 (PDT) Received: from ?IPv6:2001:44b8:31ae:7b01:6542:7c58:f9eb:5a66? (2001-44b8-31ae-7b01-6542-7c58-f9eb-5a66.static.ipv6.internode.on.net. [2001:44b8:31ae:7b01:6542:7c58:f9eb:5a66]) by smtp.gmail.com with ESMTPSA id qb7sm43354151pab.47.2015.10.27.23.26.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Oct 2015 23:26:30 -0700 (PDT) Sender: Kubilay Kocak Reply-To: koobs@FreeBSD.org Subject: Re: Speedup ports install References: <20151027220549.2bb7a660@sol> To: soralx@cydem.org, ports@FreeBSD.ORG From: Kubilay Kocak Message-ID: <56306A8E.3070009@FreeBSD.org> Date: Wed, 28 Oct 2015 17:26:22 +1100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:42.0) Gecko/20100101 Thunderbird/42.0 MIME-Version: 1.0 In-Reply-To: <20151027220549.2bb7a660@sol> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2015 06:26:31 -0000 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