Thread: Update 4.2
View Single Post
09/23/18, 10:37 AM   #5
sirinsidiator
 
sirinsidiator's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2014
Posts: 1,578
The new profiling api is awesome. Great job and many thanks!
I played around with the data today and easily got it hooked up with the google chrome profiler.


A few things would be nice if they could be changed in the future though.
  • There are no records for api methods. This makes it a bit hard to determine which api is responsible for slow lua code, without moving them into separate lua methods.
  • Tail recursive calls are missing from the records. They just jump directly from the caller to the callee.
  • It would be great if there was some way to tell which action (handler, event type) caused a function call. Maybe some additional record type which returns the event type, namespace or control name, start and end time for when the event callbacks, updates and control handlers are executed could be added.
  • chrome profiler supports showing the arguments that are passed to a function. maybe this data could also be returned by the api, similar to how it was added to the errors and debug.tracebacks?
  • a record type that marks the frame start and end time + cpu and memory usage during that frame could also be nice


EDIT: it also seems that there is something funky going on. The records contain the following stack trace, which is impossible since SetId doesn't call any methods:
Code:
IsMenuVisisble (@EsoUI/Libraries/ZO_ContextMenus/ZO_ContextMenus.lua:135)
ZO_AutoComplete:IsOpen (@EsoUI/Libraries/Utility/ZO_AutoComplete.lua:149)
ZO_AutoComplete:Hide (@EsoUI/Libraries/Utility/ZO_AutoComplete.lua:143)
ZO_AutoComplete:OnTextChanged (@EsoUI/Libraries/Utility/ZO_AutoComplete.lua:299)
AutocompleteOnTextChanged (@user:/AddOns/LibSlashCommander/LibSlashCommander/LibSlashCommander.lua:86)
<anonymous function> (@EsoUI/Libraries/Utility/ZO_AutoComplete.lua:95)
Measurement:SetId (@user:/AddOns/LibGPS/Measurement.lua:32)
EDIT2: Seems that GetScriptProfilerClosureInfo somehow returned the wrong closure info. Subsequent profiling runs show the following stack which seems to be correct:
Code:
IsMenuVisisble (@EsoUI/Libraries/ZO_ContextMenus/ZO_ContextMenus.lua:135)
ZO_AutoComplete:IsOpen (@EsoUI/Libraries/Utility/ZO_AutoComplete.lua:149)
ZO_AutoComplete:Hide (@EsoUI/Libraries/Utility/ZO_AutoComplete.lua:143)
ZO_AutoComplete:OnTextChanged (@EsoUI/Libraries/Utility/ZO_AutoComplete.lua:299)
AutocompleteOnTextChanged (@user:/AddOns/LibSlashCommander/LibSlashCommander/LibSlashCommander.lua:86)
<anonymous function> (@EsoUI/Libraries/Utility/ZO_AutoComplete.lua:95)
<anonymous function> (@EsoUI/Libraries/Utility/ZO_Hook.lua:32)

Last edited by sirinsidiator : 09/23/18 at 12:53 PM.
  Reply With Quote