New Widget: Profiler

New Widget: Profiler

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
MelTraX
Posts: 470
Joined: 02 Jan 2007, 16:18

New Widget: Profiler

Post by MelTraX »

I made this for my own but I release it in case some other devs or players are interested..
This is useful for widget devs and players who want to know which widget slows them down..

It just shows all active widgets and the time it takes for some callins (configured with a table in the file) to execute.

Note that it needs to be reloaded whenever you toggle another widget.
Download

Image
Last edited by MelTraX on 08 Apr 2008, 22:37, edited 1 time in total.
User avatar
Vadi
Posts: 446
Joined: 03 Jan 2008, 14:51

Re: New Widget: Profiler

Post by Vadi »

Could it please be re-hosted?
User avatar
LordMatt
Posts: 3393
Joined: 15 May 2005, 04:26

Re: New Widget: Profiler

Post by LordMatt »

You should PM MelTraX directly, has he doesn't read the forums much at all.
User avatar
det
Moderator
Posts: 737
Joined: 26 Nov 2005, 11:22

Re: New Widget: Profiler

Post by det »

I've hosted it here for you.

There is also a a gadget made by jK that can profile both widgets and gadgets but must be included in the mod. You can find it here.
User avatar
Vadi
Posts: 446
Joined: 03 Jan 2008, 14:51

Re: New Widget: Profiler

Post by Vadi »

Thank you very much!
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7031
Joined: 16 Nov 2004, 13:08

Re: New Widget: Profiler

Post by zwzsg »

det wrote:There is also a a gadget made by jK that can profile both widgets and gadgets but must be included in the mod. You can find it here.
I would like to profile KP gadgets.

I tried using jK profiler, however:
- First it complained about VFS.Include(SCRIPT_DIR .. 'callins.lua', nil, VFS.ZIP_ONLY) but that was easy to fix.
- Then it complains that 95: attempt to index local 'gh' (a nil value). A few line above it does local gh = gadgetHandler.gadgetHandler
- I tried just replacing it with gh = gadgetHandler but then the profiler doesn't list any gadget.
- jK told me to use CA gadget handlers. (But not what files does that entail precisly.)
- So I copied \LuaRules\*.lua from C.A..
- faction.lua cause issue when outside CA, but that was easy to fix.
- But then most of KP gadgets failed!
- After some investigation I found it was due to GameStart not being called.
- Then TheFatController told me to use BA Chicken Defense gadget handlers, which are based of CA but do have the gamestart called.
- So I did, but then dbg_profiler.lua complained about gh being nil again.
- Then I mixed BACD's gadgets.lua with CA's gadgets.lua, and the profiler worked, but I was back at the profilder listing 0 gadgets using 0.0% FPS, which is obviously wrong.
- As an aside, having to prefix all commands to gadgets by /LuaRules is rather inconvenient. I wish I could type /uprofile instead of /luarules uprofile.

To sum it up, can anyone help me get a gadget profiler that work in a mod other than CA?
User avatar
ginekolog
Posts: 837
Joined: 27 Feb 2006, 13:49

Re: New Widget: Profiler

Post by ginekolog »

I found that some widgets in ZK make CPU spikes for me.

Do anyone know, how could I detect widget that is making CPU spikes? Widget profiler only shows comulative percentage per widget and i would need graph or usage in ~last second .

TY.
Post Reply

Return to “Lua Scripts”