LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Timing issues (https://www.linuxquestions.org/questions/programming-9/timing-issues-328927/)

eagle683 05-31-2005 12:33 PM

Timing issues
 
Hey all,

I've been given a project to port a unix program to a linux server. I have that part done; however, it does not run as effeciently as it should.

The program is in C.

Are there any timing issues that I have to resolve with using either the gettimeofday() or the timeval struct on converting from Unix to Linux?


Also, if you don't think this is the problem but might suspect something else, please share your thoughts

thanks in advance

Eagle

paulsm4 05-31-2005 06:56 PM

Hi -

Two things:

1. As far as "performance", you definitely want to profile your app for any "hot spots" or bottlenecks.

I presume you used GNU cc. Here's a good tutorial on using the GNU profiler:

http://www.cs.utah.edu/dept/old/texinfo/as/gprof.html

2. Don't give too much credence to the timings you get back from gettimeofday(). Just because it returns values to the microsecond, that doesn't necessarily mean that those values are *accurate* to the microsecond.

Generally, the smallest unit of granularity I'd have much confidence in is
down to the millisecond (*not* microsecond!).

'Hope that helps .. PSM

eddiebaby1023 06-01-2005 08:31 AM

How efficiently do you think it should run? You're not really giving us any information to base our responses on.

eagle683 06-01-2005 01:16 PM

The problem was fixed, thanks for those who replied.

It was not a programming problem, it ended up being a network program.

Once switched to the smaller (in size), faster network, it worked fine.

It is a program that tests reliability, so it was only running at 95% instead of normal - 99.5% approx.

paulsm4 06-01-2005 01:35 PM

Hi -

Cool - I'm glad you got things squared away.

For whatever it's worth, I'm definitely curious: "95%" ... of *what*?

For example, did you run "vmstat" during your tests and see excessive I/O waits and low CPU utilization?

Please let us know, if you get a chance!

Thanx in advance .. PSM

PS:
And please do consider playing with "gprof". I think you'll like it!


All times are GMT -5. The time now is 02:32 PM.