![]() When using qmake, you can set suitable flags for compiling and linking on the qmake command line like this: You can then use the gprof program to produce a report based on the collected data. On exit, your program will save profiling data in a file called gmon.out. Essentially, you need to compile and link your code with the -pg option and then run it normally. The GNU gcc/g++ compiler supports performance profiling. Keeping these rules in mind, let's look at some of the common profiling tools of interest to Qt developers. Profiling tools help you identify where the time is being spent in your application so you can focus on that 20% or less of code that is responsible for the majority of execution time. Software performance often follows a so-called 80/20 rule where 20% of the code takes 80% of the execution time (and typically the ratio is much higher than this). Then, use tools to identify where the bottlenecks are and focus on them. The key point here is not to optimize your code until you have a correct, clearly written, and unoptimized solution. Rule 2: (for experts only) - Don't do it yet. Some well-known advice on this topic, attributed to the programmer Michael A. ![]() ![]() Developers often have a desire to speed up their code to make it run more quickly.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |