GitHub user andrewgaul opened a pull request:
https://github.com/apache/thrift/pull/30
Do not line buffer code generator output
Line buffering results in slow performance on FUSE- and network-based
file systems, e.g., eCryptfs. std::ostream << std::endl emits a
newline and flushes buffers to the kernel[1], yielding excessive
system calls. Instead, emit "\n" which does the equivalent without
the flush[2]. The attached patch accomplishes this while minimizing
code churn by removing "using namespace std" and introducing a static
variable endl.
[1] http://www.cplusplus.com/reference/ios/endl/
[2]
http://stackoverflow.com/questions/5492380/what-is-the-c-iostream-endl-fiasco
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/andrewgaul/thrift std-endl
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/thrift/pull/30.patch
----
commit 8a3c01aa69275b26a72a7f86d3e1f6ea2d622567
Author: Andrew Gaul <[email protected]>
Date: 2013-01-04T00:39:56Z
Do not line buffer code generator output
Line buffering results in slow performance on FUSE- and network-based
file systems, e.g., eCryptfs. std::ostream << std::endl emits a
newline and flushes buffers to the kernel[1], yielding excessive
system calls. Instead, emit "\n" which does the equivalent without
the flush[2]. The attached patch accomplishes this while minimizing
code churn by removing "using namespace std" and introducing a static
variable endl.
[1] http://www.cplusplus.com/reference/ios/endl/
[2]
http://stackoverflow.com/questions/5492380/what-is-the-c-iostream-endl-fiasco
----