[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: parsing improvement
- From: Brigham Toskin <brighamtoskin@...>
- Date: Sat, 30 May 2015 08:31:49 -0700
Just thought I'd point out that using something like LPEG will probably end up bumping your memory usage up more than a bit of redundant string data. You might want to benchmark something like:
string.sub(data, string.find(data, "<.=/>"), startpos):gsub(pattern_to_visit_fields, function(...) ... end )
Obviously this own't compile, and you probably need to break it up some to update your bookkeeping, but you get the idea. Might be worth testing against other things in terms of memory and speed.