Server profiling failing using the debug library

I am currently trying to debug an attack for a boss character which is causing massive amounts of lag (specifically, RunJob and Sound are spanning multiple bars and ping raises to over 400ms during it). I’ve attempted to narrow down what’s causing the lag using the debug library to no success.

I am using profilebegin and profileend in my scripts to check the performance of certain segments of my code. My debug implementation looks roughly like this:

debug.profilebegin("BossAttack")
StartStuff(function ()
    foo()
    bar()
    debug.profilebegin("StrongCauseForConcern")
    baz()
    debug.profileend()
    qux()
end)
debug.profileend()

The result I’m getting in attempting to profile is this:

There’s no evidence that the debug library is client-side only and judging by the documentation, this should be legal. That being said, my profiles just will not show. Am I only able to accurately use this from the client? If so, how do I directly debug specific server-side performance problems?

None of the Developer Hub articles have been useful. They are either suggesting using the MicroProfiler which I can’t because of this problem or to use various analysis windows which I can’t because those measure overall stats and don’t allow me to log specific sections of code for performance. It’s really frustrating.

1 Like

Figured it out. The warning doesn’t matter (?) and there’s literally a section in the MicroProfiler tab of the Developer Console called “ServerProfiler” which allows me to track performance on the server. Good thing I was still tacking away at the problem after posting the thread, never would’ve known otherwise.

Despite the warnings in the console (which are on the server view while I’m profiling the server), my profiles show up as expected in the capture. I’ve been able to identify them in the detailed view and I also learned a thing or two about the profiler while I was at it. My developer-made labels are registered as UserToken timers and it seems I can have up to 100 profiles open.

Great. I might be able to do something now.

4 Likes