From 323cfece323328e34ade259fcb0545f36a9d5c18 Mon Sep 17 00:00:00 2001 From: Peter Boettcher Date: Wed, 15 Apr 2026 08:09:02 -0400 Subject: [PATCH] ConfigureLog: Eliminate unnecessary flush to improve write performance Replace `std::endl` with simple newline to eliminate performance issue caused by a `write()` system call per line issued to the configure log. The addition of the `find-v1` configure log item in commit e94ace226b (Merge topic 'configure-log-find-v1', 2025-04-29, v4.1.0-rc1~266) caused a large increase in the size of the configure log (1300 lines to 36000 lines in one test case) and exposed this latent performance issue. It caused serious (10x) degradation in configure time when run on common filesystems where `write()` is expensive, such as WSL or NFS. --- Source/cmConfigureLog.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmConfigureLog.cxx b/Source/cmConfigureLog.cxx index b486cc3df3..ce7f8415ef 100644 --- a/Source/cmConfigureLog.cxx +++ b/Source/cmConfigureLog.cxx @@ -120,7 +120,7 @@ cmsys::ofstream& cmConfigureLog::BeginLine() void cmConfigureLog::EndLine() { - this->Stream << std::endl; + this->Stream << '\n'; } void cmConfigureLog::BeginArray()