LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 05-31-2005, 12:33 PM   #1
eagle683
Member
 
Registered: May 2005
Posts: 38

Rep: Reputation: 15
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
 
Old 05-31-2005, 06:56 PM   #2
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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
 
Old 06-01-2005, 08:31 AM   #3
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
How efficiently do you think it should run? You're not really giving us any information to base our responses on.
 
Old 06-01-2005, 01:16 PM   #4
eagle683
Member
 
Registered: May 2005
Posts: 38

Original Poster
Rep: Reputation: 15
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.
 
Old 06-01-2005, 01:35 PM   #5
paulsm4
Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
dhdpcd timing out jplev22 Linux - Wireless Networking 9 09-12-2005 02:30 PM
kudzu Keeps Timing Out timswim78 Linux - Software 1 02-19-2005 01:11 PM
timing in c++ deveraux83 Programming 2 04-20-2004 05:34 PM
eth0 timing out rohde Linux - Networking 2 10-04-2003 04:49 AM
timing a process jonfa Linux - General 3 10-11-2001 04:33 PM


All times are GMT -5. The time now is 03:58 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration