Path: utzoo!mnetor!uunet!husc6!bbn!rochester!PT.CS.CMU.EDU!IUS1.CS.CMU.EDU!edw From: edw@IUS1.CS.CMU.EDU (Eddie Wyatt) Newsgroups: comp.lang.c Subject: Re: Don't use Scanf() Message-ID: <1115@PT.CS.CMU.EDU> Date: 13 Mar 88 18:36:07 GMT References: <2401@ihwpt.ATT.COM> <320@c10sd1.StPaul.NCR.COM> <2057@svax.cs.cornell.edu> Sender: netnews@PT.CS.CMU.EDU Organization: Carnegie-Mellon University, CS/RI Lines: 33 Keywords: C stdio library In article <2057@svax.cs.cornell.edu>, belmonte@svax.cs.cornell.edu (Matthew Belmonte) writes: > > Imagine again. The generated code will be a push of the address of the argument > But this doesn't alter the fact that > IT JUST DOESN'T MAKE ENOUGH DIFFERENCE FOR THE PROGRAMMER TO CARE. printf and > puts are both linear-time algorithms. printf probably takes a little longer > because it has to check for embedded format strings, but it doesn't find any in > this case, so the extra time is negligible. I've tried staying out of this STUPID conversation but ..... It all depends. One of the routines I've written was a database dump facility. The object was to dump the entire contents of the database in some human readable format and later to be able to parse the dump file and reload the database. Anyway, I was looking for ways to decrease the dump time and one of the things I did was to replace calls to fprintf on unformatted strings with calls to a routine that printed just a string using putc. In doing this I was able to get about a 20% increase in speed. Not too much, but for what took all of an hour to do, I would say a reasonable investment. In general however your comments stands. BTW: Dicky Moe, if you don't want people replying to your articles, don't bother posting them on the net. Followups to /dev/null annoys the hell out of me! -- Eddie Wyatt e-mail: edw@ius1.cs.cmu.edu