aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Support/raw_ostream.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Support/raw_ostream.cpp')
-rw-r--r--llvm/lib/Support/raw_ostream.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 7b9b8b2f53fb..fae4a4308fd7 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/lib/Support/raw_ostream.cpp
@@ -84,8 +84,15 @@ raw_ostream::~raw_ostream() {
}
size_t raw_ostream::preferred_buffer_size() const {
+#ifdef _WIN32
+ // On Windows BUFSIZ is only 512 which results in more calls to write. This
+ // overhead can cause significant performance degradation. Therefore use a
+ // better default.
+ return (16 * 1024);
+#else
// BUFSIZ is intended to be a reasonable default.
return BUFSIZ;
+#endif
}
void raw_ostream::SetBuffered() {