protocompile icon indicating copy to clipboard operation
protocompile copied to clipboard

Add test case for latest fuzzer timeout issue and fix the pathological performance

Open jhump opened this issue 1 year ago • 0 comments

The pathological test case was taking ~10 seconds (!!). Now it's just 200ms.

The issue was that it was relying on ast.FileInfo to provide things like the line numbers for tokens. But those are all computed on-demand. And this operation was being done enough that it induced pathological bad performance.

So now we have just a little bit more book-keeping in the lexer so that we can decide when to donate a comment to prior token as a trailing comment without having to ask the file info to compute things.

jhump avatar Sep 23 '24 15:09 jhump