![]() |
|
#1
|
|||
|
|||
Compiled executable speedDear friends,
I need to optimize a C++ project (or in particular a video Decoder) so that after compilation, the executable (Under DOS) can work faster than before (for it to work for Internet streaming applications). I think in this case, which compiler to choose is definitely an issue, does anyone have any idea about this? Furthermore, can you give me some suggestions as what types of source code writing styles (how to structure loops, how to access class members etc) could speed things up? Besides, are there any other major points that I should pay attention to when trying to speed up things? Sorry for so many questions, any comment is highly appreciated! Best regards, David |
|||
|
#2
|
||||
|
||||
|
Quote:
I only know that to gain optimum performance from compiler. You compile with release settings instead of debug settings with selecting maximum compiler optimizations. The 'release' version settings is essentially the same as omitting debug information as the debug setting creates (after linking) an executable that includes many additional information for the debugger. Most compilers also allow processor specific optimizations for instruction set. (e.g. x486, x586, Pentium4, MMX extension - most traditional being x386 set of instructions) .. this can make your code more effective if you e.g. optimize for pentium4 but then it may not run at all in previous processors. Quote:
About the "code writing style" the key factors are:
Quote:
you can compile with debug options after which you analyze with debugger where your program spends most of its time. (which function, which loop) if you cannot optimize the C code any further then you may consider writing the performance critical part in inline assembly. Quote:
|
|
#3
|
|||
|
|||
|
You can use gprof if you're on linux to track performance on a function level. I also have a question on optimizing.
Will the compiler optimize this? strlen("STUFF"); Would the compiler create a variable for the strlen variable so it doesn't call it twice? char *a = malloc(2000*strlen(v)); char *b = malloc(2000*strlen(v)); |
|
#4
|
|||
|
|||
|
Dear Maprich,
Many thanks to your reply, it's been very helpful, it points out directions where I should follow. I'll take some time to think about these points in detail and then post my thoughts, thanks again. Atomical, thanks for you reply too. Unfortunately, I don't have access to a linux machine, so.. but I was told that I could use Inter Complier to view the performance on the function level in Windows, so maybe I should go from here. ;-) david |
Recent GIDBlog
Vista ?Widgets? on Windows XP by LocalTech
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What AGP speed do I have? | crassbones | Computer Hardware Forum | 3 | 22-Dec-2004 18:37 |
| *executing problems | mattchew008 | C++ Forum | 1 | 14-Nov-2004 01:25 |
| Download speed limit | Maniac | Apache Web Server Forum | 1 | 09-Mar-2004 04:40 |
| Alexa testing site speed - Desilva.biz in top 1% ! | jrobbio | Web Hosting Forum | 5 | 17-Jan-2004 18:30 |
| Could you test the speed of this domain for me | jrobbio | Websites Reviewed Forum | 8 | 21-Jan-2003 14:24 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The