From owner-freebsd-ports-bugs@freebsd.org Wed Nov 9 12:15:06 2016 Return-Path: Delivered-To: freebsd-ports-bugs@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 EA7D9C37E02 for ; Wed, 9 Nov 2016 12:15:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C0A63373 for ; Wed, 9 Nov 2016 12:15:06 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uA9CF6r0028242 for ; Wed, 9 Nov 2016 12:15:06 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 213614] optimize copytree_* Date: Wed, 09 Nov 2016 12:15:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Ports Framework X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: commit-hook@freebsd.org X-Bugzilla-Status: In Progress X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: mat@FreeBSD.org X-Bugzilla-Flags: exp-run? X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 Nov 2016 12:15:07 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D213614 --- Comment #7 from commit-hook@freebsd.org --- A commit references this bug: Author: mat Date: Wed Nov 9 12:14:47 UTC 2016 New revision: 425793 URL: https://svnweb.freebsd.org/changeset/ports/425793 Log: Optimize COPYTREE_* macros. The main problem slowing down those macros was that it was ending up calling chmod(1) once for each file and directory. It was doing this because it was running find(1) in the source tree and needed to chmod in the target tree, so it had to append the full path to the chmod(1) calls, which made it impossible to use -exec +. Rewrite the -exec calls to call sh and cd into it before running chmod(1) and do so on as many files as we can using the -exec + construct. While there, optimize a bit more after figuring out that it is possible to only use one find(1) to run two -exec for different options. Also switch to using the more powerfull modern regular expressions instead of the usual basic regular expressions by using find -E. This will allow the use of | which as no basic regular expressions equivalent (as in, for example, "*.(html|txt)") as well as the + and ? keywords, and back references. About the speed gain, I did a few tests, using time's builtin from csh (t= able with all the data available in the review), comparing the home baked vers= ions of COPYTREE_SHARE found in ports, it boils down to: | version | www/sit (~2k) | www/mathjax (~30k) | +------------+------------------+--------------------+ | home baked | 0.032u 0.104s | 0.946u 7.446s | | current | 0.281u 0.649s | 5.446u 18.626s | | new | 0.024u 0.081s | 0.770u 7.012s | PR: 213614 Submitted by: mat Exp-run by: antoine Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D8283 Changes: head/Mk/bsd.port.mk --=20 You are receiving this mail because: You are on the CC list for the bug.=