LinuxQuestions.org
Visit Jeremy's Blog.
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 07-22-2004, 03:01 PM   #1
Sinner6
LQ Newbie
 
Registered: Mar 2004
Distribution: United Linux(they forced me to)
Posts: 16

Rep: Reputation: 0
slower on linux


I need help. As those familiar with my whining will know I am porting a IA64 program to linux from windows. Everything seems to be going well. EXCEPT performace for one of our libraries(written in almost straight C++).
For test A linux under performs by 15% in test B linux underperforms by 40%!!!

The only difference is that on linux I am using setitimer, signal for SIGALRM, and gettimeofday.
On window I am using CreateTimerQueueTimer, QueryPerformanceCounter.

And yes I am using intels compiler on linux.
 
Old 07-22-2004, 03:58 PM   #2
Hano
Member
 
Registered: Sep 2001
Location: Venezuela, Caracas
Distribution: RedHat 9.0
Posts: 196

Rep: Reputation: 30
without more info or the code of the most time consuming parts (have you profiled yet?) is near to impossible to guess what to say to you that may be helpful
 
Old 07-23-2004, 07:10 AM   #3
Sinner6
LQ Newbie
 
Registered: Mar 2004
Distribution: United Linux(they forced me to)
Posts: 16

Original Poster
Rep: Reputation: 0
I can't profile for some reason. I compile gcc foo.cpp -lpthread. and when I run a.out I get a SIGILL for some reason. I am using gcc 3.2.2 on an ia64.
 
Old 07-23-2004, 08:24 AM   #4
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
I think by profiling he means to compile with the -pg option and then to use the gprof command.
 
Old 07-23-2004, 08:41 AM   #5
Sinner6
LQ Newbie
 
Registered: Mar 2004
Distribution: United Linux(they forced me to)
Posts: 16

Original Poster
Rep: Reputation: 0
Yes I compile with -pg and the I get the SIGILL

gcc foo.cpp -pg -lpthread

foo.cpp

const long SIZE = 100000;
int main()
{
long arr[SIZE];
for( int i = 0; i < SIZE; i++ )
arr[i] = (i + 4) * (i - 2) + SIZE - i;

return 0;
}

Last edited by Sinner6; 07-23-2004 at 08:43 AM.
 
Old 07-23-2004, 08:53 AM   #6
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
Do you get SIGKILL when running your compiled code? Not during the compile.

If you run ./a.out you create a mon.out file.
Then
gprof ./a.out
produces the profile information for you.
 
Old 07-23-2004, 09:23 AM   #7
Sinner6
LQ Newbie
 
Registered: Mar 2004
Distribution: United Linux(they forced me to)
Posts: 16

Original Poster
Rep: Reputation: 0
Yea I the SIGILL when I run a.out. It dies before it ever produces gmon.out
The compile looks fine, no warnings, no errors. but the I run a.out and bam SIGILL, Invalid Instruction
 
Old 07-23-2004, 11:38 AM   #8
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 36
Okay. Something is not right. Do you have a thread sending SIGKILL?
Ordinarily applicaions don't send suicide signals unless programmed to do so.

Edit:
I just saw the 'invalid instruction'. You have a library module problem it sounds like. If you know how, try a fully static link. Then run it. Why? We want to make sure the problem is in the shared libraries only, otherwise you found a bug. If nothing else you get to see how much disk space you save by linking shared

Last edited by jim mcnamara; 07-23-2004 at 11:42 AM.
 
Old 07-23-2004, 12:21 PM   #9
itsme86
Senior Member
 
Registered: Jan 2004
Location: Oregon, USA
Distribution: Slackware
Posts: 1,246

Rep: Reputation: 59
Why do you name the file with a .cpp extension? It looks like it's just C code so should have a .c extension. If you're compiling C++ code use the g++ command. Also, I don't see any thread stuff in there so why are you linking in the pthread library?

Try just: gcc -Wall -pg foo.c -o foo

In fact, profiling won't even give you anything useful because you're not doing any function calls. It will just say it's spending all its time in main().

::

Last edited by itsme86; 07-23-2004 at 12:24 PM.
 
Old 08-06-2004, 08:44 AM   #10
Sinner6
LQ Newbie
 
Registered: Mar 2004
Distribution: United Linux(they forced me to)
Posts: 16

Original Poster
Rep: Reputation: 0
I upgraded from SuSe 8 to SuSe 9 and that seemed to fix it. Maybe it was a version of a library or gcc but it seems to work now.
 
  


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
Why is Mandrake/KDE getting slower and slower? KWTm Mandriva 12 09-28-2004 09:43 PM
New to Linux - Slower than XP? osxjamie Linux - Software 8 09-17-2004 11:40 AM
Internet connection becomes slower and slower. caesius_01 Linux - General 1 03-14-2004 02:59 PM
webbrowsing much slower in linux? l2ich84 Linux - General 3 02-09-2004 09:11 AM
Linux slower? Cutlass Linux - Newbie 9 10-01-2002 05:17 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:35 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration