|
-
November 20th, 2003, 04:36 AM
#1
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
-
November 20th, 2003, 05:14 AM
#2
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.
-
November 20th, 2003, 05:19 AM
#3
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.
-
November 20th, 2003, 10:24 PM
#4
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.
-
November 21st, 2003, 09:19 AM
#5
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.
-
November 21st, 2003, 11:23 AM
#6
IIRC the latest MS V++.NET compiler has support for SSE/SSE2, but you have to enable it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|