lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I then tried it on my real-world code, and it saves the memory usage
> there too.
> 
> However, in that case, it's somewhat _slower_ than the "loop outside
> lpeg" version, about 10% slower: 2m30s vs. 2m15s to parse about a
> ~700MB file.
> 
> [...]
> 
> I find this a little surprising ... I'd think that even with lpeg.Cmt
> around each clause, that wouldn't be any more expensive than
> repeatedly calling lpeg.match for each clause instead...
> 
> Any clues as to why it's slower?

It is indeed a little surprising... Maybe the capture is interfering
with some specific LPeg optimization?

-- Roberto