[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Improving regexp-opt
From: |
Stefan Monnier |
Subject: |
Re: Improving regexp-opt |
Date: |
Fri, 12 Apr 2019 12:53:06 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> The pros:
> If the resulting strings "came from" a regexp that is splittable, the
> FA implementation always simplifies to it. In pratice, these are
> uncommun, and in most cases, the results are equivalent.
>
> The cons:
> The algorithm for FA seams to have greater computation complexity,
> takes about 20 times to compute in average.
Furthermore, even when the result is noticeably shorter, have you
compared the performance of the regexp-matcher? I expect that you won't
be able to see a measurable difference there.
IOW it's just not a good deal.
As I said, if you really want to improve on regexp-opt, you have to go
through a *real* DFA and that means not returning a regexp but a DFA, so
it's a completely different beast from `regexp-opt`.
Stefan