Skip to content

Do not line buffer code generator output#30

Closed
gaul wants to merge 1 commit intoapache:trunkfrom
gaul:std-endl
Closed

Do not line buffer code generator output#30
gaul wants to merge 1 commit intoapache:trunkfrom
gaul:std-endl

Conversation

@gaul
Copy link
Copy Markdown
Member

@gaul gaul commented Jan 4, 2013

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

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
@gaul
Copy link
Copy Markdown
Member Author

gaul commented Jan 4, 2013

@gaul gaul closed this Jan 4, 2013
@gaul gaul deleted the std-endl branch January 4, 2013 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant