Make stderr go faster

This change makes _IONBF (unbuffered) stdio handles go 20x faster for
certain kinds of formatting directives by being smarter about buffers
This commit is contained in:
Justine Tunney 2023-08-11 11:56:35 -07:00
parent 2cbd09b4d4
commit 8fc778162e
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
6 changed files with 70 additions and 38 deletions

View file

@ -432,7 +432,7 @@ privileged static size_t kformat(char *b, size_t n, const char *fmt,
FormatUnsigned:
if (x && hash) sign = hash;
for (i = j = 0;;) {
x = DivMod10(x, &rem);
x = __divmod10(x, &rem);
z[i++ & 127] = '0' + rem;
if (pdot ? i >= prec : !x) break;
if (quot && ++j == 3) {