2017-09-12 15:54:08 UTC
This change does not affect the current gnulib-tool.py, just `python`
Still this change is going to be integrated later into the gnulib-tool.py.
I've been testing a new command-line parsing along with parsing cached
configuration (configure.ac, gnulib-cache.m4 and gnulib-comp.m4 processing).
I've noticed that we spend a lot of time whilst processing the contents of
AC_PREREQ and AC_CONFIG_AUX_DIR macros. These regular expressions have the
following form (I've removed some junk):
In Python, however, it seems to be enough to just use the following form:
Once I started using the latest form, the time required to process each of
these regular expressions decreased for about half a second. The regex works
even on the following cases:
I suspect that the original form just was a copy-paste from the original
gnulib-tool, where it could have been used due to the usage of sed to parse
the contents of the configure.ac file. So the questions are:
1. Is the new behavior correct?
2. Shall I push this small optimization?
I'd like to do it, because right now everything else I've rewritten works
almost instantly, but I still have some doubts. What do you think?
BTW, the version from the pygnulib differs a bit already from the
shell script; I've attached the patch. I've also decided to use raw string
literals just to make regex less verbose.
With best regards,