CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    12

    Question How can I made my application run faster without changing of hardware e.g memory, cpu

    Hi all,

    Can any one advise if i would want my application written in C/C++ to run faster without changing of hardware components ? I have tried set the Processpriorty of the C++ code to highest/timecritical but the improvement in speed is minimum.

    Note : I have upgraded my window from Win98 to Win 2000, but experienced the slow down of processing speed.

    Thanks
    James

  2. #2
    Join Date
    Oct 2002
    Location
    Singapore
    Posts
    3,128
    May be you can change your compiler option to optimize your code for speed.

    If that is not good enough, you may like to optimize the code yourself. However, you should use a profiler to determine which function call that is causing the bottleneck before optimizing.

  3. #3
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150
    That's a difficult question without extra information.
    • If you're using some kind of algorithm in your code, try to optimize that algorithm BEFORE you start optimizing your code. Always optimize your algorithm before you optimize your implementation!
    • Are you using some loops in your code? If so, try to optimize them. Move some calculation outside the loop, etc...
    • Try to play with the optimization parameters of your compiler.
    • Try using another compiler, for example the Intel C/C++ compiler.
    • If you're targeting a processor with an extended instruction set like for example MMX/SSE/SSE2/3DNOW, try to use these extensions.
    • If you're targetting multi-processor systems, try to multithread your app to take advantage ot this.
    • etc, etc,....


    You should give some more information about your app, for a more targetted answer.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  4. #4
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    12
    Thanks for replies.

    The code was written in Turbo C , a 16 bit compiler that runs only for Win9x enviroment. I have converted the 16 bit into 32 bit using Borland C compiler targeted for win2000 enviroment.
    The time for a task completion is abt 20 - 30% in difference for 2 application wrtten in Turbo and borland C. I am looking for a quick fix for the speed problem, e.g. a application package (I heard of there are some commerial software that enable application to run 100 times faster) or cheap and easy method that can enable my application to run faster.


    Method that i have tried
    1. optimise the compiler option to Max Speed.
    2. Set Process Priorty to highest so it can get max CPU processing time.
    3. Optimise the code (cant do much in optimzation as the full program is very huge and its going to take alot of time and tedious to do so)
    With all the methods i have tried, i managed to increase the processing speed by another 5 - 10%.

    Marc, can Borland C application be compiled in Intel C/C++ compiler? i think it will get a lot of compilation error if to do so, just like VC cant compile in Borland C.
    I cant move calcuation outside the loop, as the calculation is part of the process of the program.

    james
    Last edited by James Goh; November 20th, 2003 at 10:27 PM.

  5. #5
    Join Date
    Jun 2002
    Location
    Germany
    Posts
    1,557
    James,

    Heed the words of Marc. Make sure that your algorithms are well designed, as best as possible.

    There is no technology available which can offer a 100-fold improvement in normal PC applications.

    Intel C/C++ compilers offer the absolute best run-time performance available on the market for Intel-based PC applications. The second best is the C/C++ compiler from Microsoft Visual Studio.NET, not in managed mode. Unfortunately, the Microsoft compilers hardly use any machine codes above those of a Intel 386. The Intel compilers fully use the silicon.

    Sincerely, Chris.

    You're gonna go blind staring into that box all day.

  6. #6
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150
    IIRC the latest MS V++.NET compiler has support for SSE/SSE2, but you have to enable it.
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured