LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 09-29-2007, 06:11 AM   #1
MrFixit
Member
 
Registered: Aug 2004
Posts: 32

Rep: Reputation: 15
why is Ubuntu slower then XP for my C++ app?


Hello,
I have programmed in c++ a simple particles simulation using glut, opengl, std (math and list) functions.

I've compiled my code with gcc 4.1 with -o3 flag and using MMX, SSE, SSE2, SSE3 (-match = prescott) - so that it's optimized for my computer.

on windows i did the same using the latest MinGW port of gcc...

I set the frame rate to 33FPS, and count how many calculations per sec i get in the IdleFunc:

on Ubuntu it's 22000, while on winXP it's 27000...
both operating systems use the latest drivers...

any ideas?
 
Old 09-29-2007, 06:25 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 63
There's a lot of variables which you would need to isolate in order to answer the question. Here's some I can think of off the top of my head, I'm sure there are many more:
  • Driver efficiency is different - maybe the Linux driver was compiled with a less efficient compiler or with less optimisations enabled.
  • Maybe some of the GPU resources are being used for something else under Linux (do you have compiz or similar enabled?)
  • Perhaps the version of the compiler you used isn't really the same.
  • Maybe the system is busy with another task in the background.
  • Maybe windows is simply faster for the task you chose. There are lots of reasons this might be the case - maybe the way the memory gets mapped happens to result in more cache hits (less slow calls to main memory) and so on.

Testing these ideas would mean writing some different programs. Performance analysis isn't easy

Turn on profiling and see if you can isolate where the differences are.

Last edited by matthewg42; 09-29-2007 at 06:26 AM.
 
Old 09-29-2007, 06:35 AM   #3
MrFixit
Member
 
Registered: Aug 2004
Posts: 32

Original Poster
Rep: Reputation: 15
thank you very muc for your post, I haven't used profiling until now - but i think it's worth learning =)
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
FC6 gets slower and slower and slower... jonrpick Linux - Software 19 11-12-2007 04:02 PM
Ubuntu App Symbol bjb_nyj101 Linux - Desktop 1 04-29-2007 01:39 PM
Ubuntu samba slower than red hat?? dgermann Linux - Networking 6 07-30-2006 06:50 PM
Why is Mandrake/KDE getting slower and slower? KWTm Mandriva 12 09-28-2004 10:43 PM
Internet connection becomes slower and slower. caesius_01 Linux - General 1 03-14-2004 03:59 PM


All times are GMT -5. The time now is 06:46 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration