Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Other Life-changing visual scripting performance discovery

Discussion in 'Visual Scripting' started by Ignacii, May 7, 2024.

?

Have you been harmed by this innocent-looking node?

  1. Yes. I knew this already

    0 vote(s)
    0.0%
  2. No. Never used it the wrong way

    2 vote(s)
    100.0%
  3. Yes. My fps went up too

    0 vote(s)
    0.0%
  4. No. Never used Custom Events in my project yet but info is useful for the future

    0 vote(s)
    0.0%
  1. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    121
    Just want to share the life-changing discovery with all fellow UVS users.

    Never use Custom Event in continuos flow (update etc.). Never. Only use them once. Use Timers as a workaround that are activated with a Custom Event once and stopped the same way using Pause. I accidentally discovered this and my project went from 60fps to 200fps. I've spent weeks optimizing stuff that had nothing to do with the real problem in my project. If it's by design, users should be warned.

    Best of luck with your projects, visual scripters!
     
  2. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,555
    Always use the Profiler when trying to optimize. It should have been able to show you that specific function call was taking a lot of time.
     
  3. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    121
    Oh no no. The profiler shows almost nothing when used with visual scripting. Maybe it does with deep profiling or in some other more complicated way, but I never tried it. Never heard anyone recommending it either in the visual scripting community to make me try.

    It's probably very useful in C# though. Are you even using visual scripting?

    Profiling in visual scripting has a gigantic room for improvement. Until the profiler shows exact nodes and it's color-coded based on how bad they are for performance with a good and intuitive design, it's basically useless until then. Showing exact graphs would be acceptable for a start. But since visual scripting is in maintenance mode for now, I'm in no way expecting or suggesting this for the near future. But it would be an amazing feature along with other necessary improvements in future versions.
     
  4. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    1,555
    Indeed it does with Deep Profiling, which is an important part of Profiling. The regular profiling mode is good for a quick identification of problem areas, and then generally you switch on Deep Profiling if it's not yet clear where the issue is.

     
    spiney199 likes this.
  5. Ignacii

    Ignacii

    Joined:
    May 23, 2013
    Posts:
    121
    I still really doubt it's easy to understand and find the exact graph and node, especially when I use only 1 script machine for all my project's code for better performance, but thanks for the info. I might give it ago one day if I'm desperate with performance problems again.