From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jackson Ray Hamilton Newsgroups: gmane.emacs.devel Subject: Re: [elpa] master b7d8d3c 9/9: * fixtures/test/: Don't byte-compile Date: Mon, 19 Dec 2016 22:04:23 -0800 Message-ID: References: <20160805013757.31623.20092@vcs.savannah.gnu.org> <20160805013758.9B5BB2201A4@vcs.savannah.gnu.org> <357c3d56-6fe1-fcd1-8403-eaab95ab9af8@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------BC299B07574742F7E4B69404" X-Trace: blaine.gmane.org 1482214388 5823 195.159.176.226 (20 Dec 2016 06:13:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 20 Dec 2016 06:13:08 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.5.1 Cc: emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Dec 20 07:13:03 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cJDfa-0000Kh-3Y for ged-emacs-devel@m.gmane.org; Tue, 20 Dec 2016 07:13:02 +0100 Original-Received: from localhost ([::1]:49264 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJDfd-0006l5-22 for ged-emacs-devel@m.gmane.org; Tue, 20 Dec 2016 01:13:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57325) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cJDZ2-0001N1-R0 for emacs-devel@gnu.org; Tue, 20 Dec 2016 01:06:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cJDYz-0002Wb-L8 for emacs-devel@gnu.org; Tue, 20 Dec 2016 01:06:16 -0500 Original-Received: from mta-08-3.privateemail.com ([198.54.127.61]:50438) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cJDYz-0002Vk-EZ for emacs-devel@gnu.org; Tue, 20 Dec 2016 01:06:13 -0500 Original-Received: from [10.145.8.123] (unknown [10.20.151.213]) by MTA-08.privateemail.com (Postfix) with ESMTPA id A0C4B60038; Tue, 20 Dec 2016 06:06:05 +0000 (UTC) X-Enigmail-Draft-Status: N1110 In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 198.54.127.61 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210654 Archived-At: This is a multi-part message in MIME format. --------------BC299B07574742F7E4B69404 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Sorry, I didn't even notice the slowdown; I see now that it went from 0.9s to 1.9s on my machine. The first attached patch is simple and speeds it up to 1.65s. The second attached patch sort of re-implements what tar would do, using sh case, but it's more complex. It clocks in at 1.35s after that. Jackson On 12/19/2016 06:49 AM, Stefan Monnier wrote: >> Would you be amenable to me pushing the attached patch? >=20 > Hmm... >=20 > It works well, but it slows down "make" in the case where there's > nothing to do by more than a factor 2 (on the slowest machine on which > I maintain a fully-built `elpa` checkout, it brings the time for "make" > from 7s to 18s). The current time is already on the high side for my > taste, so I think we should try a bit harder to keep it in check. >=20 >=20 > Stefan >=20 --------------BC299B07574742F7E4B69404 Content-Type: text/x-patch; name="0001-Slightly-optimize-excluding.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Slightly-optimize-excluding.patch" =46rom adc8237cd08a14a62ac3a14a3f45ebc8530bd091 Mon Sep 17 00:00:00 2001 From: Jackson Ray Hamilton Date: Mon, 19 Dec 2016 17:26:42 -0800 Subject: [PATCH 1/2] Slightly optimize excluding. --- GNUmakefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index ab81163..9690af4 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -155,9 +155,9 @@ included_els :=3D $(shell \ ignore=3D"/dev/null"; \ fi; \ if [ -d $$pt ]; then \ - tar -ch $$pt --exclude-vcs -X "$$ignore" \ - | tar --list \ - | grep '^[^/]*/[^/]*/[^/]*\.el$$'; \ + tar -ch $$pt/*.el --no-recursion \ + --exclude-vcs -X "$$ignore" \ + | tar --list; \ fi; \ done) els :=3D $(call FILTER-nonsrc, $(included_els)) --=20 2.1.4 --------------BC299B07574742F7E4B69404 Content-Type: text/x-patch; name="0002-Optimize-exclusion-further-with-case.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0002-Optimize-exclusion-further-with-case.patch" =46rom b62ee2e2fbaccbbba7501115819e7d10eefe38d5 Mon Sep 17 00:00:00 2001 From: Jackson Ray Hamilton Date: Mon, 19 Dec 2016 21:44:18 -0800 Subject: [PATCH 2/2] Optimize exclusion further with case. TBH, I'm not nearly as confident in this code as the code it replaces, bu= t it is slightly faster. --- GNUmakefile | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 9690af4..442dd9c 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -148,17 +148,22 @@ $(foreach al, $(autoloads), $(eval $(call RULE-srcd= eps, $(al)))) # the -autoloads.el, the .el files that are marked "no-byte-compile", an= d # files matching patterns in packages' .elpaignore files. included_els :=3D $(shell \ - for pt in packages/*; do \ - if [ -f "$${pt}/.elpaignore" ]; then \ - ignore=3D"$${pt}/.elpaignore"; \ - else \ - ignore=3D"/dev/null"; \ - fi; \ - if [ -d $$pt ]; then \ - tar -ch $$pt/*.el --no-recursion \ - --exclude-vcs -X "$$ignore" \ - | tar --list; \ - fi; \ + for pt in packages/*; do \ + if [ -d $$pt ]; then \ + if [ -f "$${pt}/.elpaignore" ]; then \ + cd $$pt; \ + ls -1 *.el | while IFS=3D read -r filename; do \ + hasmatch=3D0; \ + while IFS=3D read -r pattern; do \ + case $$filename in ($$pattern) hasmatch=3D1; break= ;; esac;\ + done < .elpaignore; \ + test $$hasmatch =3D 1 || echo "$${pt}/$${filename}"; \= + done; \ + cd ../..; \ + else \ + ls -1 $$pt/*.el; \ + fi; \ + fi; \ done) els :=3D $(call FILTER-nonsrc, $(included_els)) naive_elcs :=3D $(patsubst %.el, %.elc, $(els)) --=20 2.1.4 --------------BC299B07574742F7E4B69404--