https://llvm.org/bugs/show_bug.cgi?id=30656
Bug ID: 30656 Summary: setting MacroBlockBegin / MacroBlockEnd slows down clang-format 4x Product: clang Version: unspecified Hardware: PC OS: Linux Status: NEW Severity: normal Priority: P Component: Formatter Assignee: unassignedclangb...@nondot.org Reporter: nicolaswe...@gmx.de CC: djas...@google.com, kli...@google.com, llvm-bugs@lists.llvm.org Classification: Unclassified clang-formatting all files in blink takes about 15s on my machine. We recently deleted the blink-specific .clang-format file which makes it fall back to the global chromium .clang-format file. That one sets MacroBlockBegin/End, and with that .clang-format file, reformatting all files in blink now takes about 60s. (Deleting the MacroBlockBegin / MacroBlockEnd from our global .clang-format file makes things fast again.) Here's our .clang-format file: BasedOnStyle: Chromium Standard: Cpp11 MacroBlockBegin: "^\ BEGIN_MSG_MAP|\ BEGIN_MSG_MAP_EX|\ BEGIN_SAFE_MSG_MAP_EX|\ CR_BEGIN_MSG_MAP_EX|\ IPC_BEGIN_MESSAGE_MAP|\ IPC_BEGIN_MESSAGE_MAP_WITH_PARAM|\ IPC_PROTOBUF_MESSAGE_TRAITS_BEGIN|\ IPC_STRUCT_BEGIN|\ IPC_STRUCT_BEGIN_WITH_PARENT|\ IPC_STRUCT_TRAITS_BEGIN|\ POLPARAMS_BEGIN|\ PPAPI_BEGIN_MESSAGE_MAP$" MacroBlockEnd: "^\ CR_END_MSG_MAP|\ END_MSG_MAP|\ IPC_END_MESSAGE_MAP|\ IPC_PROTOBUF_MESSAGE_TRAITS_END|\ IPC_STRUCT_END|\ IPC_STRUCT_TRAITS_END|\ POLPARAMS_END|\ PPAPI_END_MESSAGE_MAP$" This looks reasonably short and shouldn't slow down formatting 4x. (I'm not sure if ^ has higher precedence than |, but changing the regexen to "^(a|b|c)$" didn't change performance) -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs