[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs Lisp JIT Compiler
From: |
Stefan Monnier |
Subject: |
Re: Emacs Lisp JIT Compiler |
Date: |
Sun, 19 Aug 2018 16:23:11 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> Daniel> Likewise, it'd be fantastic to compile regular expressions to DFAs and
> Daniel> then generate machine code for the DFAs. You can't go faster than
> that.
> I've been meaning to experiment with this using Stefan's lex.el.
> It seems to me that the bytecode compiler could open-code some common
> things like (looking-at "some constant").
lex.el's matcher (i.e. an Elisp loop interpetering the DFA
data-structure) is already pretty fast (i.e. competitive) in my
experience compared to the C based regex.c code. So I think that
a C implementation of lex.el's matcher would already be so fast that
generating machine code for it would only make sense in extremely
rare circumstances.
> One "simple" way to improve regexp matching right now would be to remove
> the self-modifying code and change the implementation to use token
> threading, like we did for the bytecode interpreter.
Indeed, our regex.c code has a lot of room for improvement. Given its
nasty worst case behavior, I've been reluctant to invest any more time
into it.
> I think removing this self-modifying stuff is also useful if we ever
> want to introduce first-class regexp objects.
It's also needed to make it re-entrant.
Stefan
- Re: Emacs Lisp JIT Compiler, (continued)
- Re: Emacs Lisp JIT Compiler, Eli Zaretskii, 2018/08/15
- Re: Emacs Lisp JIT Compiler, Paul Eggert, 2018/08/15
- Re: Emacs Lisp JIT Compiler, Eli Zaretskii, 2018/08/15
- Re: Emacs Lisp JIT Compiler, Tom Tromey, 2018/08/15
- Re: Emacs Lisp JIT Compiler, Eli Zaretskii, 2018/08/16
- Re: Emacs Lisp JIT Compiler, Daniel Colascione, 2018/08/16
- Re: Emacs Lisp JIT Compiler, Andreas Schwab, 2018/08/16
- Re: Emacs Lisp JIT Compiler, Tom Tromey, 2018/08/19
- Re: Emacs Lisp JIT Compiler, Eli Zaretskii, 2018/08/19
- Re: Emacs Lisp JIT Compiler, Tom Tromey, 2018/08/19
- Re: Emacs Lisp JIT Compiler,
Stefan Monnier <=
- Re: Emacs Lisp JIT Compiler, Steinar Bang, 2018/08/18
- Re: Emacs Lisp JIT Compiler, Eli Zaretskii, 2018/08/18
- Re: Emacs Lisp JIT Compiler, Robert Pluim, 2018/08/19
- Re: Emacs Lisp JIT Compiler, Eli Zaretskii, 2018/08/19
- Re: Emacs Lisp JIT Compiler, Tom Tromey, 2018/08/19
- Re: Emacs Lisp JIT Compiler, Tom Tromey, 2018/08/22
- Re: Emacs Lisp JIT Compiler, Eli Zaretskii, 2018/08/23
- Re: Emacs Lisp JIT Compiler, Tom Tromey, 2018/08/24
- Re: Emacs Lisp JIT Compiler, Eli Zaretskii, 2018/08/24
- Re: Emacs Lisp JIT Compiler, Tom Tromey, 2018/08/24