[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [patches] Add support for smaller regex implementation



Carlos O'Donell wrote:
On Tue, Nov 11, 2008 at 11:16 AM, Maxim Kuvyrkov <maxim@xxxxxxxxxxxxxxxx> wrote:
+config OPTION_POSIX_REGEXP_GLIBC
+    bool "Regular expressions from GLIBC"
+    depends OPTION_POSIX_REGEXP
+    help
+       This option group specifies which regular expression
+        library to use.  The choice is between regex
+        implementation from GLIBC and regex implementation from
+        libiberty.  The GLIBC variant is fully POSIX conformant and
+        optimized for speed; regex from libiberty is more than twice
+        as small while still is enough for most practical purposes.
+

It's twice as small, but on average how much slower?

If I had to make a decision I would like to know a rough estimate of
the speed decrease.

Carlos,

It is not obvious to me what a good benchmark would be. As I understand, both implementations compile regular expression into automaton and then use it to match the pattern; the automatons produced by both implementation should be very similar (if no features specific to new implementation are used). So it is, probably, meaningful to compare only compile times for regular expressions, not the matching times.

Considering the compile times, I speculate that it is not a decision factor for most users; and, while it still is an interesting information, I don't have spare time right now to gather it.

Please let me know if I'm wrong in any of assumptions above (as I might very well be).

Thanks,

--
Maxim