This is the mail archive of the gcc-patches@gcc.gnu.org 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 <bkorb@cruzio.com>
 > 
 > Hi Kaveh,
 > 
 > In your patch:
 > 
 >   http://gcc.gnu.org/ml/gcc-patches/2000-09/msg00847.html
 > 
 > 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:
http://www.nullstone.com/htmls/category/printf.htm

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
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions

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