2 ms·
Trying this on my own lexer, increasing the channel buffer size from 10 (which is what it is now) to 512 almost doubles the runtime speed(!) I tried some other
by Beltalowda 4y ago
Trying this on my own lexer, increasing the channel buffer size from 10 (which is what it is now) to 512 almost doubles the runtime speed(!) I tried some other values, and it seems that about 5 to 15 is the "optimal size".
The input file the author uses is about 1M in size, and most of my inputs are much smaller (which is realistic for my use case); my feeling is that it's due to this, but I didn't verify; I'll have to check later and maybe set a more dynamic size based on the size of the input.
The lesson here is what we should (hopefully!) all know already: benchmark these changes because what works brilliant in situation A may be detrimental in situation B.