Hello
I am new to codelite, MinGW and GCC but I have experiences with Microsoft Visual C++.
I need to run my code as fast as possible, in certain cases it’s preferable to compile with GCC because it would run faster then. Using PGO within Visual Studio IDE is very easy, but does codelite provide any facility this task to ease up things? I have freshly installed the latest codelite on windows. Do I need to download any library for that matter? How can I build my binaries as fast as possible? Please guide me through this. Step by step. Thanks.
Profile-guided optimization
-
- CodeLite Curious
- Posts: 2
- Joined: Sat Oct 20, 2012 12:45 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
-
- CodeLite Veteran
- Posts: 67
- Joined: Mon Aug 22, 2011 10:15 pm
- Genuine User: Yes
- IDE Question: c++
- Contact:
Re: Profile-guided optimization
Look up gprof. Then you modify your code accordingly.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Profile-guided optimization
You can use -pg as well ( make sure to add it both in linker and compiler pages )
You can also use the CallGraph plugin of codelite
Eran
You can also use the CallGraph plugin of codelite
Eran
Make sure you have read the HOW TO POST thread
-
- CodeLite Curious
- Posts: 2
- Joined: Sat Oct 20, 2012 12:45 am
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Profile-guided optimization
-pg solved my problem. Thanks!
As for speedy builds, any other compiler switch should I consider? I use -pg;-O3;-fexpensive-optimizations;-Wall ; is that good? I know GCC has other options not available from IDE and latest versions add even more options. Any suggestion? Also I'd like to know what settings you generally use for the best performance.
As for speedy builds, any other compiler switch should I consider? I use -pg;-O3;-fexpensive-optimizations;-Wall ; is that good? I know GCC has other options not available from IDE and latest versions add even more options. Any suggestion? Also I'd like to know what settings you generally use for the best performance.
- eranif
- CodeLite Plugin
- Posts: 6375
- Joined: Wed Feb 06, 2008 9:29 pm
- Genuine User: Yes
- IDE Question: C++
- Contact:
Re: Profile-guided optimization
I usually use these settings:
Debug:
Release:
Nothing more.
I myself I don't use -pg
Instead, when I want analyze code (memory or performance) - I use valgrind (Linux only)
valgrind has several tools (the default tool is the memory leak tool, you can use cachegrind for performane)
There are also some nice tools that loads varlgrind into a very nice visual editor
Eran
Debug:
Code: Select all
g++ -g -O0 -Wall ...
Code: Select all
g++ -O3 -Wall ...
I myself I don't use -pg
Instead, when I want analyze code (memory or performance) - I use valgrind (Linux only)
valgrind has several tools (the default tool is the memory leak tool, you can use cachegrind for performane)
There are also some nice tools that loads varlgrind into a very nice visual editor
Eran
Make sure you have read the HOW TO POST thread