2 ms·
I did the small statistics of the lexer.c and considered it an example of the input. You have there some 3050 lines 90KB, inside of the file there are 44K space
by acqq 13y ago
I did the small statistics of the lexer.c and considered it an example of the input. You have there some 3050 lines 90KB, inside of the file there are 44K space (chr(32)) characters, giving on average more than 10 spaces per line. To process the indentation spaces faster I'd try reading them in the loop after the nl something like:
case '\n':
char* t = p + 1; // skip the nl
while ( *t == ' ' ) // skip the indent spaces
t++; // while avoiding the big switch
p = t;
continue;
I don't know if it's worth, but seems a good compromise.