Our lexer spends about 50% of its runtime constructing and maintaining source position information. Most of this information is not actually going to be used (even a very verbose error message may only need to reference about a handful).
Perhaps we should instead identify source positions simply by a character offset, and then compute column/line number as necessary by reference to the file, when needed.
Our lexer spends about 50% of its runtime constructing and maintaining source position information. Most of this information is not actually going to be used (even a very verbose error message may only need to reference about a handful).
Perhaps we should instead identify source positions simply by a character offset, and then compute column/line number as necessary by reference to the file, when needed.