Profiler unusably slow with large sample

After my huge profiler sample was collected, the profiler window froze for multiple minutes. I could actually live with that. The problem is that the profiler window is not responsive after all that waiting time. Just left-clicking any of the hierarchy elements freezes the window again for more than 10 seconds. I’m not even expanding anything yet. I really like this tool, but I keep hitting this wall when debugging more complex things with it.

Question 1: Can I do anything to work around this? Apart from trying to take smaller samples. That one is obvious.

Question 2: Is this a known issue and hopefully already being worked on? I will also file a support ticket, but wanted to ask here especially for question 1.

Hmmm I suppose “profile it” doesn’t apply here. :wink:

I see you have deep profiling enabled - if you can manage to profile without, and then as you narrow down a hotspot do a deep profile of just a few frames with deep profiling enabled. That would certainly speed things up. Deep profiling adds massive amounts of overhead.

Then of course custom profiler markers/counters - once you know a hotspot.

Though this means sprinkling these accross your code. I’d suggest a static helper class whose methods are marked with [Conditional("PROFILE")] attribute and the method body enclosed in #if PROFILE - this results in code that will be entirely stripped unless the PROFILE symbol is defined.

I’m looking at one frame that takes 20 seconds :smile:

I am using deep profiling, yes. Manual markers are an option to reduce the sample size, of course. It’s just a bit annoying that the problem seems to be the profiler UI and not the profiling itself.

Edit: Thanks for the response, by the way :slight_smile:

Hey @ravens_ben !

I suspect the issue there is more likely that we calculate impact into the frame by areas for the selected sample to be displayed on charts and that crawls all samples underneath :thinking:
That may take some time if there are millions of samples with deep profiler enabled.

I don’t think there is any nice workaround atm except that you may try to unfold the item without selecting it by clicking at the fold icon… (sorry for that :smiley: )

perhaps filing the ticket would be the best way - I can think of a few options to remove this blocker (e.g. capping the processing time or doing it async)

Thanks for the response! I will try expanding items without selecting them. And even if that doesn’t work, I will try to figure out my own performance problems with manual profiler samples. The profiler is still super helpful when I have to use that more iterative approach!

If you are beginning and ending samples in subscopes, also mark these functions with [IgnoredByDeepProfiler] (documentation) or you’ll get mismatching begin and end sample errors when deep profiling.