Thread Tools Display Modes
07-01-05, 09:04 PM   #1
Littlejohn
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 90
Lua code profiler wishes?

I wrote an event counter that I'm turning into a general purpose code profiler. It's a simple mod that hooks functions matching a pattern and keeps stats on how many times (and times/sec) they've been called.

Anybody have any wishes for profiling Lua code?

Most Lua code runs fast, but often. This makes them hard to time because the resolution of GetTime isn't quite good enough to measure one call. I've noticed that most code is side-effect free and can be called repeatedly. I was thinking about adding an option to have the profiling hook call a function repeatedly to get better accuracy. Can anybody think of a better solution to the timer accuracy problem?
 
07-02-05, 12:58 PM   #2
Littlejohn
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 90
(Was this moved? Sorry if I posted in the wrong place. Script request forum is only for players, not requests from mod authors?)
 
07-02-05, 01:03 PM   #3
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
Aye I moved it. I thought it would be more appropriate in this area of the boards, since this is where folks dealing with actual code hang out more.

It is entirely possible that I misunderstood the general direction of your thread, and shouldn't have moved it. I can move it back if you would prefer.

Last edited by Cairenn : 07-02-05 at 01:13 PM.
 
07-02-05, 01:26 PM   #4
Littlejohn
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 90
I'm too new; I trust you.

Was just hoping to get some ideas from people who are trying to performance tune their code. (WoW's scripting features are amazing, but no development tools? It's a niche I hope to carve out in the mod world
 
07-02-05, 01:28 PM   #5
Cairenn
Credendo Vides
 
Cairenn's Avatar
Premium Member
WoWInterface Admin
Join Date: Mar 2004
Posts: 7,134
Okay, so I didn't misunderstand. Yeah, this is definitely *developer*, not random_end_user_01. Which is not an insult to random_end_user_01, it's just saying that they aren't gonna care about this, whereas dev's will.
 
07-05-05, 04:31 PM   #6
Littlejohn
A Warpwood Thunder Caller
AddOn Author - Click to view addons
Join Date: Jun 2005
Posts: 90
I've finished up the next version of my Lua code profiler. First paragraph from the web page:

TraceEvent collects function call counts, calls/second, peak calls/second and average per-call memory usage of Lua global functions. The previous release was designed to trace all OnEvent functions, but v1.2 allows you to specify functions by name or pattern.
If people could play with it a bit and give me feedback, I'd really appreciate it. Parts of the UI are a little clunky, but it's still fun to play with. (Or maybe I'm just hopelessly weird.)

If anybody has downloaded Blizzard's UI customization kit, my mod can help you find the stuff you want. Trace "^%a+_" and then watch the functions as you do stuff. For example, if you want to customize mail, reset the trace stats, open a mailbox, then sort the trace stats. The top functions listed will be related to mail. (Sometimes you have to stop tracing some "noisy" code like ActionButtons in order to find the good stuff.)

http://www.vulpes.com/TraceEvent/

Thanks!
 

WoWInterface » Developer Discussions » General Authoring Discussion » Lua code profiler wishes?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off