LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   why is Ubuntu slower then XP for my C++ app? (https://www.linuxquestions.org/questions/linux-general-1/why-is-ubuntu-slower-then-xp-for-my-c-app-588175/)

MrFixit 09-29-2007 05:11 AM

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?

matthewg42 09-29-2007 05:25 AM

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.

MrFixit 09-29-2007 05:35 AM

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


All times are GMT -5. The time now is 05:22 PM.