diff options
author | Роман Донченко <dpb@corrigendum.ru> | 2014-06-27 22:10:28 +0400 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-07-06 08:08:20 +0000 |
commit | afa8f21f56f1e65bb2ec37cffdf3422d15b45347 (patch) | |
tree | bbb9b85dfdcc347cc44ce681e724ea80eb857923 /epan/dissectors | |
parent | 3490bc6eb923e7e8666f9ad9213b0f5010a91c03 (diff) |
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 <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors')
-rw-r--r-- | epan/dissectors/Makefile.am | 10 | ||||
-rw-r--r-- | epan/dissectors/Makefile.nmake | 10 |
2 files changed, 10 insertions, 10 deletions
diff --git a/epan/dissectors/Makefile.am b/epan/dissectors/Makefile.am index 80a066c078..b48d3edd52 100644 --- a/epan/dissectors/Makefile.am +++ b/epan/dissectors/Makefile.am @@ -86,11 +86,11 @@ x11-dissector: $(top_srcdir)/tools/process-x11-fields.pl x11-fields $(top_srcdir # pass only the first few names in the list to the shell, for some # reason. # -# Therefore, we have a script to generate the register.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 "dissectors", to indicate that we should build diff --git a/epan/dissectors/Makefile.nmake b/epan/dissectors/Makefile.nmake index 0af94105ca..35edf09baf 100644 --- a/epan/dissectors/Makefile.nmake +++ b/epan/dissectors/Makefile.nmake @@ -65,11 +65,11 @@ packet-rrc.obj : packet-rrc.c # pass only the first few names in the list to the shell, for some # reason. # -# Therefore, we have a script to generate the register.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 "dissectors", to indicate that we should build |