public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug stdio/31183] New: Wide stream buffer size reduced MB_LEN_MAX bytes after bug 17522 fix
@ 2023-12-20 15:43 fweimer at redhat dot com
  2023-12-20 15:43 ` [Bug stdio/31183] " fweimer at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2023-12-20 15:43 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=31183

            Bug ID: 31183
           Summary: Wide stream buffer size reduced MB_LEN_MAX bytes after
                    bug 17522 fix
           Product: glibc
           Version: 2.21
            Status: NEW
          Severity: normal
          Priority: P2
         Component: stdio
          Assignee: fweimer at redhat dot com
          Reporter: fweimer at redhat dot com
  Target Milestone: ---

After the fix from bug 17522, we do not use the remaining buffer space if the
already-written buffer space is smaller than MB_LEN_MAX (16 bytes).  As we
start out with no written bytes (zero), we never use the full buffer, greatly
reducing performance.

The fix probably explains it better:

-         if (fp->_IO_write_ptr - fp->_IO_write_base < sizeof (mb_buf))
+         if (fp->_IO_buf_end - fp->_IO_write_ptr < sizeof (mb_buf))
            {
              /* Make sure we have room for at least one multibyte
                 character.  */
              write_ptr = write_base = mb_buf;
              buf_end = mb_buf + sizeof (mb_buf);
            }

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-02 13:43 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-20 15:43 [Bug stdio/31183] New: Wide stream buffer size reduced MB_LEN_MAX bytes after bug 17522 fix fweimer at redhat dot com
2023-12-20 15:43 ` [Bug stdio/31183] " fweimer at redhat dot com
2023-12-20 16:17 ` fweimer at redhat dot com
2024-01-02 13:43 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).