Profiling editor window

Hi there,

I’m trying to profile my asset but I’m having a hard time. I searched for an answer to this but couldn’t find it…

I’m using BeginSample/EndSample in my code and I know that section takes a long time (well, over 100ms) since I’m using a stopwatch and doing a debug.log. However, I can’t find that section in the profiler output.

I started calling that part of the code in my update method, expecting to see it every few frames (I can’t remember exactly how often onupdate get called for editor windows), but the numbers don’t even come close to that.

Here’s an image of my profiler window: Imgur: The magic of the Internet

Notice the range (about 32ms) of the profiler CPU section.

What am I doing wrong? Is there a way to constrain deep profiling to only a certain namespace?

I tried not doing the deep profile, but that my begin/endsample sections are shallow (only detailing what happens in that method).

Also, any way to get the profile to hold on to more data? It looks like whatever I want to look at just zooms by.

I also tried using Profiler.enabled and Profiler.logFile but the file comes out empty at 0 bytes (still with a write/read lock on it). Any ideas?