This project is read-only.

Tuned for Performance?

Sep 24, 2014 at 12:46 PM
Has the code that is generated by GPLEX been tuned for performance?

I’m asking because I noted that of the four overloads of SetSource, the SetSource(string, int) is the fastest, slightly faster than the two having a stream parameter, and the SetSource(IList<string>) is unacceptable slow with large files (50 MB) (because of LineBuffer.findIndex).

Sep 28, 2014 at 12:44 PM
Hi Martin
You are quite right. The performance of the buffering with a list of strings as source is pretty bad. Not much can be done about this as indexing into the character position of the list as though it were a stream is really inefficient.

However, thanks for the comment. I should at least warn users about the performance in this case. And, come to think of it, if there is no choice but to use an IList then it would be possible to speed up LineBuffer.findIndex by constructing an index table on the fly, as lines are read. I guess programs only want to index backwards into lines that have been already read?

Hmm, might have a look at that next time I get a spare hour.