Xref: utzoo comp.lang.c:31613 comp.unix.questions:25254 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!rex!uflorida!haven!cs.wvu.wvnet.edu!cerc.wvu.wvnet.edu!cathedral!siping From: siping@cathedral.cerc.wvu.wvnet.edu (Siping Liu) Newsgroups: comp.lang.c,comp.unix.questions Subject: ---- Running time & code efficiency ---- Message-ID: <742@babcock.cerc.wvu.wvnet.edu> Date: 5 Sep 90 14:40:11 GMT Sender: news@cerc.wvu.wvnet.edu Lines: 23 Hi. I am trying to analyze my C code and make it run faster. The program is to translate files in one format to another. I wonder if there is a generic way to decide a lower bound of the running time for this kind of problem? I know function calls consume time so I look through the code and cut off some unnecessary ones; I know you can trade space for speed, however I wonder how far you can go along this direction. But I cannot get much from these considerations. Any comments? Suggections? What is your favorate tool for timing analysis? I used "prof" but it did not give me the timing imformation for all functions in my program -- just a few functions were listed. I also used the system provided function called "times", it is pretty good. The last questions: why doesn't the "time" command give me an identical user time each time I run the same thing? In the "time"'s report, is the time spent on the function calls by the system accounted in the user time or system time? Thank you for your help and have a nice day. siping@cerc.wvu.wvnet.edu