[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LPeg pattern optimizer
- From: Julien <julien+lua@...>
- Date: Sun, 1 Mar 2015 22:26:53 +0100
Le Sun, 1 Mar 2015 14:56:30 -0500,
Daurnimator <quae@daurnimator.com> a écrit :
>
> Nice work!
>
> I'm left wondering why lpeg doesn't do this kind of optimisation each
> time you transform a pattern (as it does other optimisations)
>
Yes, I guess that optimizer could be called at each step (at least
given the current set of optimizations), but I'm not sure about the
performance implications it may have.
> Do you have plans to get the runtime of the optimiser down?
You mean provide it as a separate library ?
Like I said, the AST optimizer can be separated from LPeg core quite
easily, the only reason I written it in lptree.c was to reuse static
helper functions. But in this situation, optimize patterns at each step
would be munch more difficult and hacky.
On the other hand, VM patches are completely tied to the core.
PS:
Le Sun, 1 Mar 2015 13:17:38 +0100,
Julien <julien+lua@desgats.fr> a écrit :
> Now I will focus on making the optimizer less dumb to be able to catch
> more optimization spots (for instance to not break if there is a
> *pattern* or a predicate match).
Typo: read capture instead of pattern :-/