From afa8f21f56f1e65bb2ec37cffdf3422d15b45347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A0=D0=BE=D0=BC=D0=B0=D0=BD=20=D0=94=D0=BE=D0=BD=D1=87?= =?UTF-8?q?=D0=B5=D0=BD=D0=BA=D0=BE?= Date: Fri, 27 Jun 2014 22:10:28 +0400 Subject: make-dissectors-reg: optimize by factoring out the loops Instead of calling the grep/sed pipelines for each file, build the list of files in the beginning and call each pipeline only once, passing the list to the first grep. This results in a massive speedup in Cygwin; in my test, the time it takes to run make-dissector-reg . dissectors packet-*.c in dissectors/epan is reduced from ~116 to ~3 seconds. I also tried it on NetBSD, where the time do to the same goes from ~6 to ~0.5 seconds. Amend makefile comments to elide mentions of invoking multiple processes per file. Change-Id: Iad441e7d2b6cc3669dada57646e2f8f6b987fd34 Reviewed-on: https://code.wireshark.org/review/2826 Reviewed-by: Anders Broman --- plugins/mate/Makefile.nmake | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/mate/Makefile.nmake') diff --git a/plugins/mate/Makefile.nmake b/plugins/mate/Makefile.nmake index 48fcaf39f7..7d301d9694 100644 --- a/plugins/mate/Makefile.nmake +++ b/plugins/mate/Makefile.nmake @@ -70,11 +70,11 @@ $(PLUGIN_NAME).dll $(PLUGIN_NAME).exp $(PLUGIN_NAME).lib : $(OBJECTS) $(LINK_PLU # pass only the first few names in the list to the shell, for some # reason. # -# Therefore, we have a script to generate the plugin.c file. -# The shell script runs slowly, as multiple greps and seds are run -# for each input file; this is especially slow on Windows. Therefore, -# if Python is present (as indicated by PYTHON being defined), we run -# a faster Python script to do that work instead. +# Therefore, we use a script to generate the register.c file. +# There are two versions of the script, a shell and a Python version. +# The Python script runs faster, since it uses caching to speed up +# repeated runs and doesn't invoke external processes, so we prefer +# that if Python is available. # # The first argument is the directory in which the source files live. # The second argument is "plugin", to indicate that we should build -- cgit v1.2.3