[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: rx.el sexp regexp syntax
From: |
Stefan Monnier |
Subject: |
Re: rx.el sexp regexp syntax |
Date: |
Sun, 27 May 2018 16:23:07 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
>> It would be interesting to compare the performance. This also means
>> that there would be no need for caching on behalf of the supporting
>> language.
>
> I will predict that an rx interpreter built in Lisp will be two orders
> of magnitude slower than the current regexp machine, where both the
> construction of an automaton, and the byte-code interpreter which runs
> it are written in C (and probably quite optimised C at that).
The lex.el package in GNU ELPA has a matcher written in Elisp.
Its performance is actually pretty good compared to Emacs's builtin
regexp engine. But that's because lex.el builds a DFA, so the slow
evaluation of Elisp is compensated by a more efficient algorithm.
And of course, building the DFA takes a lot more time than the
regexp-compilation of regexp.c (both because of the language used and
the algorithm).
Stefan
- Re: rx.el sexp regexp syntax, (continued)
- Re: rx.el sexp regexp syntax, Philipp Stephani, 2018/05/29
- Re: rx.el sexp regexp syntax (WAS: Off Topic), Alan Mackenzie, 2018/05/25
- Re: rx.el sexp regexp syntax, Michael Heerdegen, 2018/05/25
- Re: rx.el sexp regexp syntax, Peter Neidhardt, 2018/05/25
- Re: rx.el sexp regexp syntax (WAS: Off Topic), Peter Neidhardt, 2018/05/25
- Re: rx.el sexp regexp syntax, Tom Tromey, 2018/05/27
- Re: rx.el sexp regexp syntax, Alan Mackenzie, 2018/05/27
- Re: rx.el sexp regexp syntax,
Stefan Monnier <=
- Re: rx.el sexp regexp syntax, Stefan Monnier, 2018/05/27
- Re: rx.el sexp regexp syntax, Pierre Neidhardt, 2018/05/28
- Re: rx.el sexp regexp syntax, Stefan Monnier, 2018/05/28