mirror of
https://github.com/fluencelabs/musl
synced 2025-07-01 15:42:05 +00:00
trivial optimization to printf: avoid wasted call frame
amusingly, this cuts more than 10% off the run time of printf("a"); on the machine i tested it on. sadly the same optimization is not possible for snprintf without duplicating all the pseudo-FILE setup code, which is not worth it.
This commit is contained in:
@ -6,7 +6,7 @@ int printf(const char *fmt, ...)
|
|||||||
int ret;
|
int ret;
|
||||||
va_list ap;
|
va_list ap;
|
||||||
va_start(ap, fmt);
|
va_start(ap, fmt);
|
||||||
ret = vprintf(fmt, ap);
|
ret = vfprintf(stdout, fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user