This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch to suggest putc/fputs over printf("string") or printf("\n")
- To: law at cygnus dot com
- Subject: Re: patch to suggest putc/fputs over printf("string") or printf("\n")
- From: Jamie Lokier <egcs at tantalophile dot demon dot co dot uk>
- Date: Sat, 16 Jan 1999 11:13:24 +0000
- Cc: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>, egcs-patches at cygnus dot com, egcs at cygnus dot com
- References: <19990116005107.A1636@tantalophile.demon.co.uk> <6672.916484637@hurl.cygnus.com>
On Sat, Jan 16, 1999 at 04:03:57AM -0700, Jeffrey A Law wrote:
> > - putc is almost always larger than printf, though much faster.
> Huh? Consider how much conversion code you bring in to handle floating point
> via printf... It's utterly amazing.
>
> > - puts requires separate library code, when just printf would have done.
> > Often, the calling sequence is the same for both.
> printf's library support code is quite large due to the conversions...
Granted. What I really mean is: if a program already uses printf....
Inline putc is usually much larger at the caller than calling printf.
OTOH, putc when called as a function is nice and small at the caller.
It would be nice to avoid pulling in the floating point conversions when
possible :-)
-- Jamie