Path: utzoo!utgpu!water!watmath!clyde!rutgers!gatech!bloom-beacon!tut.cis.ohio-state.edu!uwmcsd1!ig!agate!ucbvax!hoptoad!gnu From: gnu@hoptoad.uucp (John Gilmore) Newsgroups: comp.lang.c Subject: Final postscript on the printf() versus puts() debate Message-ID: <4252@hoptoad.uucp> Date: 27 Mar 88 12:43:30 GMT References: <212@philce.UUCP> Organization: Grasshopper Group in San Francisco Lines: 14 One thing it seems everybody missed is that if printf() is slower than puts(), the thing to do is not to rewrite all your programs to use puts(), or change the compiler to convert printf() to puts(); the thing to do is speed up the common cases of printf()! Chris Aoki and I did this at Sun, years ago, when a new-hire in the compiler group was wasting his time changing printf()s to puts()s. An hour's worth of work resulted in speeding up *every* program, not just the ones we had time to manually edit puts()'s into. It's now about equally fast on Suns to printf() a string or puts() it, as it ought to be. After all, it's really the same loop, with one extra test for %! -- {pyramid,ptsfa,amdahl,sun,ihnp4}!hoptoad!gnu gnu@toad.com "Watch me change my world..." -- Liquid Theatre