Edi Weitz wrote:
However, are you really sure that the O(n) operation of looping through the registers is causing performance problems? Have you profiled the code? This looks like premature optimization to me.
I'm pretty sure that whatever you'll do to "improve" this (filters or changing CL-PPCRE internally to return more information for example) you'll end up with something even slower.
I am guilty of premature optimization at some level, but I think flex has set the bar high for scanner performance. I'll spend more time examining performance to see if this is really needed.
That doesn't feel right. I wouldn't create regex strings first just to parse them into s-expressions afterwards. Why don't you start with s-expressions right away?
I'll change COMBINE-REGEXPS to only call CL-PPCRE::PARSE-STRING for strings (and assume other data is an appropriate s-expression). I'd like to make this very similar to lex / flex in allowing users of this package to use regular expressions. I'm not worried about the parsing performance because I am doing this at compile time (via a macro, DEFSCANNER).