HighCommander4 wrote:

A few additional notes:

 * I chose the value `1 << 20` for `MaxLinesToProcess` empirically to get 
`guessLanguage()` to return in about 1 second on my 
(average-for-a-developer-machine) hardware. I don't feel strongly about the 
value and I'm happy to go with a different one.
 * The reason I didn't try to impose the limit on all uses of 
`UnwrappedLineParser` is that I wasn't sure what the impact would be on the 
results of trying to format an affected file. As such, trying to format such a 
file still hangs / OOMs, but that's still an issue that fewer people will run 
into than the `guessLanguage()` hang which occurs any time such a file is even 
opened in clangd. As such, I think the patch in its currently form still has a 
lot of value.

https://github.com/llvm/llvm-project/pull/78925
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to