[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: LPEG and the order of alternatives in ordered choice
- From: Paul K <paul@...>
- Date: Thu, 11 Sep 2014 03:26:29 +0000
Hi Peng,
> I suppose for patterns other than of single character, the order really
> should affect the perfomance. could you test it again using complex patterns?
Thank you for the explanation. I tested on 10-char patterns, but
'1'-first performs better than 'a'-first on some tests (20-50
iterations for 100M char string).
lpeg.match((lpeg.S('1111111111')+lpeg.S('aaaaaaaaaa'))^0, str)
Anything else I should try?
Paul.