Page 1 of 1

Widget Profiler with moar GUI

Posted: 27 Jan 2015, 15:46
by Silentwings
I made a version of the Widget Profiler which groups widgets into Game, User and API/Special. You can find it here http://imolarpg.dyndns.org/trac/balates ... ofiler.lua or attached below. I've only tested it with BA (and its included in BA 8.08+).

It also shows the % in varying degree of red, depending on how much time the widgets callins took and if the current FPS is low enough to care. See the code for exact formula, which is a totally subjective piecewise linear function with magic constants that I just made up.

Image

Re: Widget Profiler with moar GUI

Posted: 27 Jan 2015, 17:56
by Jools
Silentwings wrote:
It also shows the % in varying degree of red, depending on how much time the widgets callins took and if the current FPS is low enough to care. See the code for exact formula, which is a totally subjective piecewise linear function with magic constants that I just made up.
I tried to look but could not immediately find the formula. Is the formula subjective with regard to the colour formatting or time calculation?

+ award for British spelling of colour

Re: Widget Profiler with moar GUI

Posted: 27 Jan 2015, 18:04
by hokomoko
Looks wonderful! did you consider sorting the results (based on load/alphabetically)?
IIRC capability was already there, just commented out (although I may confuse it with the gadget profiler).


https://gcc.gnu.org/codingconventions.html#Spelling
Even though I prefer British spelling when writing, coding standards go with American English, mainly to make searching for/within files possible (you really don't want to open unknown code and search for both "colour" and "color")

Re: Widget Profiler with moar GUI

Posted: 27 Jan 2015, 18:15
by Jools
The issue I have with these widgets/gadgets is that they flood the whole screen if you have many of them. Would be really nice if non-consuming ones could just be removed from list, or set to no alpha if that is easier.

I read that convention and I completely agree. I also prefer British spelling but have started using the standard american "color" because it's in use everywhere.

Re: Widget Profiler with moar GUI

Posted: 27 Jan 2015, 18:50
by Silentwings
The widgets are sorted alphabetically within each category. I did once sort it by % (years ago, actually) and it wasn't good because they just jump around too much; it's easier to see what's going on with colour. The colour is chosen by the CheckLoad function and the sort function is SortFunc. Feel free to change them, I'm happy as it is :)

Re: Widget Profiler with moar GUI

Posted: 31 Jan 2015, 14:47
by jamerlan
I think version with bars was better. These % are hard to read and understand. That is why analogue clocks better then digital ones.

Re: Widget Profiler with moar GUI

Posted: 31 Jan 2015, 14:57
by Silentwings
I have never seen a version with bars (and I would prefer to see the numbers, in any case). But I imagine it would be easy to merge the GUI from my version onto the one with bars.

The number is (for each widget) the % of time (out of all the time used by all of Spring, as measured by Spring.DiffTimers) spent by the widgetHandler processing that widgets callins, during a recent time interval & iirc with a little smoothing. The callin in brackets is that widgets most expensive callin.

Re: Widget Profiler with moar GUI

Posted: 07 Dec 2021, 16:26
by raaar
I've started using this widget profiler and it's been very useful, thanks!