Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feature Request Filter a certain method call from the profiler

Discussion in 'Editor & General Support' started by TawRat, Nov 6, 2023.

  1. TawRat


    Oct 11, 2023

    I'd like to request a feature to be able to filter out certain methods from the profiler; for example, RClick on a method in the hierarchy -> Hide. This entry should be then hidden from the graph and grayed out in the hierarchy (perhaps moved to the end regardless of values).

    Why do I want this?
    Sometimes when profiling, you get tons of calls, which will not be present in the final version of the game.
    Let me give you an example:
    You have a game, which is using URP. For some reason, URP is filled with ProfilerScope calls. Then, you look at the graph and find out, that your rendering is taking up 87% of the whole games performance. And what in the rendering? ProfilingScope.ctor(). Since you can profile only a development build, you can not get rid of this call. There is no #if you can call to disable this. Since it is inside the Unity's package registry, you can't add one either. What does this lead to? Incorrect profiling information in 100% of the time when using URP.

    If I could hide the whole highlighted part of the graph, I could finally see where exactly is the problem, without having to click thru every frame, manually going thru the hierarchy.

    dgoyette likes this.
  2. MartinTilo


    Unity Technologies

    Aug 16, 2017
    Hi there,

    I hear your feature request and that it may be beneficial in other cases, and have submitted it to our backlog via our public Roadmap and the "submit an idea" form on your behalf.

    But what you're describing here was a bug in URP that should have been fixed on newer patch versions/all supported LTS versions. If it isn't, please do file a bug report for that so we can remedy that.

    Until we get to look at this as a feature addition and UX improvement, you can use the Profile Analyser and exclude the samples in that tool.