GCC modified for the FreeChainXenon project
Find a file
Charles-François Natali 3f1519eef5 libstdc++: basic_filebuf: don't flush more often than necessary [PR63746]
`basic_filebuf::xsputn` would bypass the buffer when passed a chunk of
size 1024 and above, seemingly as an optimisation.

This can have a significant performance impact if the overhead of a
`write` syscall is non-negligible, e.g. on a slow disk, on network
filesystems, or simply during IO contention because instead of flushing
every `BUFSIZ` (by default), we can flush every 1024 char.
The impact is even greater with custom larger buffers, e.g. for network
filesystems, because the code could issue `write` for example 1000X more
often than necessary with respect to the buffer size.
It also introduces a significant discontinuity in performance when
writing chunks of size 1024 and above.

Instead, it makes sense to only bypass the buffer if the amount of data
to be written is larger than the buffer capacity.

Signed-off-by: Charles-Francois Natali <cf.natali@gmail.com>

libstdc++-v3/ChangeLog:

	PR libstdc++/63746
	* include/bits/fstream.tcc (basic_filbuf::xsputn): Remove
	1024-byte chunking that bypasses the buffer for large writes.
	* testsuite/27_io/basic_filebuf/sputn/char/63746.cc: New test.
2022-11-08 17:35:14 +00:00
c++tools
config
contrib Manually add ChangeLog entries from r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 2022-11-06 12:12:47 +01:00
fixincludes
gcc bpf: Use enum for resolved overloaded builtins 2022-11-08 08:37:04 -08:00
gnattools
gotools
include Manually add ChangeLog entries from r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 2022-11-06 12:12:47 +01:00
INSTALL
intl
libada
libatomic
libbacktrace
libcc1 Daily bump. 2022-11-02 00:17:38 +00:00
libcody
libcpp Daily bump. 2022-11-06 11:05:22 +00:00
libdecnumber
libffi
libgcc Daily bump. 2022-11-06 11:05:22 +00:00
libgfortran
libgo
libgomp Manually add ChangeLog entries from r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 2022-11-06 12:12:47 +01:00
libiberty
libitm Daily bump. 2022-11-01 00:19:02 +00:00
libobjc
libphobos Daily bump. 2022-11-06 11:05:22 +00:00
libquadmath
libsanitizer
libssp
libstdc++-v3 libstdc++: basic_filebuf: don't flush more often than necessary [PR63746] 2022-11-08 17:35:14 +00:00
libvtv Daily bump. 2022-11-01 00:19:02 +00:00
lto-plugin
maintainer-scripts
zlib
.dir-locals.el
.gitattributes
.gitignore
ABOUT-NLS
ar-lib
ChangeLog Manually add ChangeLog entries from r13-3652-ge4cba49413ca429dc82f6aa2e88129ecb3fdd943 2022-11-06 12:12:47 +01:00
ChangeLog.jit
ChangeLog.tree-ssa
compile
config-ml.in
config.guess
config.rpath
config.sub
configure Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
configure.ac Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
COPYING
COPYING.LIB
COPYING.RUNTIME
COPYING3
COPYING3.LIB
depcomp
install-sh
libtool-ldflags
libtool.m4
ltgcc.m4
ltmain.sh
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
MAINTAINERS
Makefile.def Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
Makefile.in Remove support for Intel MIC offloading 2022-11-04 10:51:01 +01:00
Makefile.tpl
missing
mkdep
mkinstalldirs
move-if-change
multilib.am
README
symlink-tree
test-driver
ylwrap

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.