curdeius added a comment. I see indeed that this change fixes the superlinear complexity when formatting code from stdin:
cat test.cpp | time clang-format --style=LLVM 0:01.44 == 1.44s // 9 returns 0:13.17 == 13s // 10 returns 1:56.63 == 116s // 11 returns time clang-format --style=LLVM test.cpp 0.03s-0.05s And after this change the stdin case takes as much time as with a file. It's definitely a good change, but I'd like to understand what's the reason, why stdin is handled so much differently? Have you investigated this? Also, a sort of performance test (e.g. a test with a timeout) would be nice to have. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D114837/new/ https://reviews.llvm.org/D114837 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits