General > Developers Corner
Hook diagnostics
Buzzkill:
Thanks. Not looking for bugs in ULib per se, but measurements are 80% of the battle. I have no idea if I'm running at peak performance or wasting cycles in a horribly coded addon if I don't measure.
I went to hook.lua first, actually. I could get lots of info from there, including timing on specific functions attached to the hooks. I noticed I can't do brute force debug messages (ie, 'print', which is nil inside hook.lua). Is the env within hook.lua non-global?
I was also thinking if this had any wheels that wrapping it up as an addon would be problematic if I were attaching directly to core code.
OMG... drooling as I look at DBugR. Thanks. Will go play with that now.. because... you know... it's Tuesday at 1:55 and I should be working, but this is more fun. :)
Buzzkill:
:) Installed. This makes my work with blind hook timers look pathetic.
Stickly Man!:
Yeah, I can't remember the specifics as to why, but any things you need to use in the hook.lua file must be declared as local at the top of the file. Print is already listed there, but commented out. Uncomment them and you should be able to print just fine. :)
https://github.com/Nayruden/Ulysses/blob/master/ulib/lua/ulib/shared/hook.lua#L12-L13
Haha, let me know if you fully figure out DbugR- I played around with it for a while once, but not long enough to figure out all it could do. :) Oh, crap, work. I should be doing that now! *closes forums* :P
Edit: But hey! Doing them manually with timers helps you understand and appreciate how it all works! :)
Aaron113:
--- Quote from: Stickly Man! on April 07, 2015, 11:05:41 AM ---Yeah, I can't remember the specifics as to why, but any things you need to use in the hook.lua file must be declared as local at the top of the file.
--- End quote ---
That's because it's a module. I couldn't tell you as to why exactly it is that way, but the brief explanation. It's kind of like python or c++ I suppose, where you have to import the libraries you want to use so it doesn't have a bunch of useless functions that it never runs. I don't entirely understand the logic behind it with GLua, but yeah.
And DBugR looks pretty amazing, that would've been useful to have a few years ago.
Buzzkill:
The data coming from this thing is amazing. Already identified some rather poor coding choices in some of my addons (iterating through every spawned entity in a Think() just to find one in particular? Really?? :) )
Do we know what the unit of measure is for the Value column in Pinpointing? I looked through the FP threads and couldn't find anything concrete. Haven't cracked open the code yet, but will if no one knows off the top of their heads. I'm assuming it's a relative measure (eye, ostime between call and return, like I was doing above), but that's just an assumption.
Thanks again.
--- Quote ---Edit: But hey! Doing them manually with timers helps you understand and appreciate how it all works! :)
--- End quote ---
Agree 100%. :)
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version