Profiling and Optimizing app

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2171
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Profiling and Optimizing app

Post by evstevemd » Sat Jun 16, 2018 11:10 am

Hi,
I have this app that have grown to be a monster ;)
Now the app is sometimes slow and I cannot figure out which parts contribute to that. I know I can start disconnecting parts to figure out but that is time consuming. Is there a simple profiler? I only need to see method calls and time they consume,e so that I can optimize that.

KCache is a bit complex to analyze and could not find any good beginners documentation.

What do you guys use to profile and optimize your apps?
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 15.04/Windows 10 Pro - GCC/MinGW, CodeLite IDE et al]

User avatar
doublemax
Moderator
Moderator
Posts: 13602
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Profiling and Optimizing app

Post by doublemax » Sat Jun 16, 2018 11:57 am

I only know the profiling tools in Visual Studio, so i can't help with that.

But as a programmer you should have a general idea when the application is slow. What are the symptoms? Slow redraws? Slow reaction to user actions?

Do you use wxUpdateUIEvent? That's a real performance killer.
Use the source, Luke!

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2171
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Re: Profiling and Optimizing app

Post by evstevemd » Sun Jun 17, 2018 6:34 am

doublemax wrote:I only know the profiling tools in Visual Studio, so i can't help with that.

But as a programmer you should have a general idea when the application is slow. What are the symptoms? Slow redraws? Slow reaction to user actions?

Do you use wxUpdateUIEvent? That's a real performance killer.
I have a general view, since the slow part is on saving file, so at least I have idea of where it happens. But the boggling part is, it sometimes does not happen. So I don't get the exactness of the problem.

After sifting I have only two options:
1. Isolating different functionalities to get the offending block and then deal with that
2. Use Profiler and go straight to the problem.

I have never used VS since VS2005 If I remember well so it cannot help. I guess I have to go to the first option, no choice unfortunately :oops:
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 15.04/Windows 10 Pro - GCC/MinGW, CodeLite IDE et al]

Manolo
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 689
Joined: Mon Apr 30, 2012 11:07 pm

Re: Profiling and Optimizing app

Post by Manolo » Mon Jun 18, 2018 4:26 pm

Using GCC compiler you can use two different profilers:
* GCOV: https://gcc.gnu.org/onlinedocs/gcc/Gcov.html#Gcov
* GPROF: There are some toturials in the Web.

If the bottleneck is saving to a file, then my wild guess is that your best option is to use std::streams (or wx' streams). Also, the way you fill the file may be sub-optimal.

User avatar
evstevemd
Part Of The Furniture
Part Of The Furniture
Posts: 2171
Joined: Wed Jan 28, 2009 11:57 am
Location: United Republic of Tanzania
Contact:

Re: Profiling and Optimizing app

Post by evstevemd » Mon Jun 18, 2018 6:25 pm

Manolo wrote:Using GCC compiler you can use two different profilers:
* GCOV: https://gcc.gnu.org/onlinedocs/gcc/Gcov.html#Gcov
* GPROF: There are some toturials in the Web.

If the bottleneck is saving to a file, then my wild guess is that your best option is to use std::streams (or wx' streams). Also, the way you fill the file may be sub-optimal.
Thanks for pointing out. I will check the links.
I develop mostly on MacOs but won't mind using Linux if that solves my problem.
Chief Justice: We have trouble dear citizens!
Citizens: What it is his honor?
Chief Justice:Our president is an atheist, who will he swear to?
[Ubuntu 15.04/Windows 10 Pro - GCC/MinGW, CodeLite IDE et al]

Post Reply