From d83a6d8bafbf2afa3ebcf9e006bf0c7414f9b2dc Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 3 May 2013 00:25:49 +0000 Subject: Use unbuffered I/O. This reduces the runtime by about half. Our implementation is now only about 5 times slower than gcc's. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@180980 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/profile/GCDAProfiling.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib') diff --git a/lib/profile/GCDAProfiling.c b/lib/profile/GCDAProfiling.c index 653f641f7..3e0fff25f 100644 --- a/lib/profile/GCDAProfiling.c +++ b/lib/profile/GCDAProfiling.c @@ -194,6 +194,9 @@ void llvm_gcda_start_file(const char *orig_filename, const char version[4]) { } } + /* Make the file I/O unbuffered. */ + setbuf(output_file, (char*)NULL); + /* gcda file, version, stamp LLVM. */ fwrite("adcg", 4, 1, output_file); fwrite(version, 4, 1, output_file); -- cgit v1.2.3