This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to add __builtin_printf -> fputs transformations

 > From: Bruce Korb <>
 > Hi Kaveh,
 > In your patch:
 > I would generally oppose spending time on such a project because
 > the time savings are not likely to be worth it.  But that is done
 > now.

Hi Bruce,

Thanks for your opinion. ;-)

Nevertheless, my testing on solaris2.7 indicates that
fputs("hello-world\n",stdout) in isolation is about 40% faster than
printf("hello-world\n").  I get similar double or even triple digit
percentage speedups for the other transformations I wrote.  Obviously
your overall improvement depends on how much time you spend doing
printf's suitable for optimization relative to other tasks, but that
is true of any optimization.

See this URL for some more incentive:

Gcc scored 42% on the nullstone printf test while a Mac compiler
scored a 92% relative to "perfect".  The numbers on the site are a
couple of years old.  However I don't have reason to believe gcc's
score in this area has improved since then, prior to my work.

Kaveh R. Ghazi			Engagement Manager / Project Services		Qwest Internet Solutions

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]