C++ Server Application built using VS2008 compiler is slow

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sendil kumar
    New Member
    • Sep 2007
    • 26

    C++ Server Application built using VS2008 compiler is slow

    Hi All,

    I'm working for a software company which primarily deals with the semiconductor manufacturing. Earlier we have our server applications built using VS2005 compiler. Now started to migrate to VS2008 application. The application now built using VS2008 compiler is slower in ruuning when compared to the application built in VS2005.

    That is we see a 3% degradation in ovearall performace. The code for both the application remains same.

    Do I need to trun on/off any of th compiler options in VS2008, so that the our Application performance remains same as VS2005?
  • weaknessforcats
    Recognized Expert Expert
    • Mar 2007
    • 9214

    #2
    I assume you are compare release build run times. Yes?

    Also, have you loooked at the assembly code generated by each compiler to verify that VS2008 is generating more code?

    Finally, is the server itself the same server? Yours is the first posting I have seen that says VS2008 is slower than VS2005.

    BTW: VS2010 is out. Why not use it?

    Comment

    • Sendil kumar
      New Member
      • Sep 2007
      • 26

      #3
      Hi,

      I tried out some options suggested by people from microsoft forumn.

      1) Tried using the SSE and SSE2 instruction set in 2008. There was even some performance degradation in VS 2008.

      2) We also found out that the VS 2008 ostream operation is 10% slower than the VS 2005 ostream. I confirmed this using the sample program

      Code:
      int _tmain(int argc, _TCHAR* argv[])
      {
           std::ostrstream os;
          os << "abc";
          int loopCount = 20000000;
          
          cout << "VC 2005 Compiler " << endl;
          cout << "Loop Count is " << loopCount << endl;
      
          timenow("Start Time : ");
          for(int outer = 0; outer < loopCount; outer++)
          {
              for(int inner = 0; inner < 20; inner++)
              {
                  os << "1234567890";
                  os << ",";
              }
              os << "\n";
          }
          timenow("End Time : ");
       return 0;
      }
      3) We are using Makefiles, which has all the compiler settings, to compile the projects. We are not using the default compiler options defined in the VS IDE(as seen under Properties -> C/C++ -> Command Line)

      4)Tried with the Secure_SCl option both in 2005 and 2008. With this option both 2005 and 2008 are 1% faster. This makes 2005 still better than 2008.

      I didn't compare the assembly code, but I guess there could be some difference. Because the binary size is greater when compiled with VS2008. The code which was compiled in VS2005 and VS2008 is same.
      Last edited by Niheel; Jul 9 '10, 07:13 AM. Reason: please use code tags (# button in editor) to display code

      Comment

      Working...