unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jackson Ray Hamilton <jackson@jacksonrayhamilton.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [elpa] master b7d8d3c 9/9: * fixtures/test/: Don't byte-compile
Date: Mon, 19 Dec 2016 22:04:23 -0800	[thread overview]
Message-ID: <dc141dda-ceb2-04da-c295-dff0085c5265@jacksonrayhamilton.com> (raw)
In-Reply-To: <jwv7f6wgesx.fsf-monnier+emacsdiffs@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 837 bytes --]

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?
> 
> Hmm...
> 
> 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.
> 
> 
>         Stefan
> 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Slightly-optimize-excluding.patch --]
[-- Type: text/x-patch; name="0001-Slightly-optimize-excluding.patch", Size: 911 bytes --]

From adc8237cd08a14a62ac3a14a3f45ebc8530bd091 Mon Sep 17 00:00:00 2001
From: Jackson Ray Hamilton <jackson@jacksonrayhamilton.com>
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 := $(shell \
           ignore="/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 := $(call FILTER-nonsrc, $(included_els))
-- 
2.1.4


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Optimize-exclusion-further-with-case.patch --]
[-- Type: text/x-patch; name="0002-Optimize-exclusion-further-with-case.patch", Size: 2000 bytes --]

From b62ee2e2fbaccbbba7501115819e7d10eefe38d5 Mon Sep 17 00:00:00 2001
From: Jackson Ray Hamilton <jackson@jacksonrayhamilton.com>
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, but 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-srcdeps, $(al))))
 # the -autoloads.el, the .el files that are marked "no-byte-compile", and
 # files matching patterns in packages' .elpaignore files.
 included_els := $(shell \
-  for pt in packages/*; do				\
-      if [ -f "$${pt}/.elpaignore" ]; then		\
-          ignore="$${pt}/.elpaignore";			\
-      else						\
-          ignore="/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= read -r filename; do		\
+                  hasmatch=0;						\
+                  while IFS= read -r pattern; do			\
+                      case $$filename in ($$pattern) hasmatch=1; break ;; esac;\
+                  done < .elpaignore;					\
+                  test $$hasmatch = 1 || echo "$${pt}/$${filename}";	\
+              done;							\
+              cd ../..;							\
+          else								\
+              ls -1 $$pt/*.el;						\
+          fi;								\
+      fi;								\
   done)
 els := $(call FILTER-nonsrc, $(included_els))
 naive_elcs := $(patsubst %.el, %.elc, $(els))
-- 
2.1.4


  reply	other threads:[~2016-12-20  6:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20160805013757.31623.20092@vcs.savannah.gnu.org>
     [not found] ` <20160805013758.9B5BB2201A4@vcs.savannah.gnu.org>
2016-08-06 17:42   ` [elpa] master b7d8d3c 9/9: * fixtures/test/: Don't byte-compile Jackson Hamilton
2016-08-06 18:29     ` Stefan Monnier
2016-12-18  0:06       ` Jackson Ray Hamilton
2016-12-18  3:18         ` Stefan Monnier
2016-12-19  2:43           ` Jackson Ray Hamilton
2016-12-19 14:49             ` Stefan Monnier
2016-12-20  6:04               ` Jackson Ray Hamilton [this message]
2016-12-20 14:53                 ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dc141dda-ceb2-04da-c295-dff0085c5265@jacksonrayhamilton.com \
    --to=jackson@jacksonrayhamilton.com \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).