Bad Editor Mode Perfomance

Forums 💬 NodeCanvas ⚙️ Support Bad Editor Mode Perfomance

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #15416
    vandelpal
    Participant

      In our project we have too many graphs. When we enter to play mode, we wait long time in Editor.

      I profile this step in Editor Iteration Profiler:

      Half of time we spend on  method: Graph ISerializationCallbackReceiver.OnAfterDeserialize()

      Why need deserialize all graphs when we enter play mode or reload assemblies? How we can avoid this?

      #15421
      Gavalakis
      Keymaster

        Hello,

        Hmm. Are you possibly using any third party plugins that force load all assets in your project? NodeCanvas does not by itself force deserialize asset graphs at all. You could disable Unity’s no domain reload in your “Project Settings/Editor/Enter Play Mode Settings”, even though it seems that something else is going on with your project judging from the profiler screenshot. Please also let me know what version of NodeCanvas are you using?

        Thanks.

        #15420
        vandelpal
        Participant

          Sorry for the late response.
          We create а big project with more than three thousand BehaviourTree assets.
          For the pure test, I made that:
          – create a new empty Unity project
          – import NodeCanvas plugin
          – import Editor Iteration Profiler plugin (https://forum.unity.com/threads/introducing-the-editor-iteration-profiler.908390/)
          – create a new folder in Assets and add all our BT assets to it
          – run empty sample scene

          Then I saw this in the Profiler ( screens in attachments)
          I do not use any third-party plugins, it simple empty unity project. The caller is Unity Enjime self! (you can see it in Stacktrace)
          Why need to use ISerializationCallbackReceiver.OnAfterDeserialize() and ISerializationCallbackReceiver.OnBeforeSerialize() methods in NodeCanvas Graph?
          Version of NodeCanvas is 3.2.5.

          #15419
          vandelpal
          Participant

            Disabling Unity’s no domain reload can not help us when we change code. When we change one cs class, we need wait reload domain with deserialization all graphs! It is awful!
            I tried AssemblyReloadEvents.beforeAssemblyReload and AssemblyReloadEvents.afterAssemblyReload to prevent call serialization/deserialisation on all graphs, it extreamely decrease time for reload assemblies but after this there are some troubles with graph in editor and NullRef Exceptions. Is there possible way to do this?

            #15418
            vandelpal
            Participant

              @Gavalakis, I found the problem, it is in class NodeCanvas.Editor.GraphAssetPostProcessor.
              This line: AssetTracker.BeginTrackingAssetsOfType(typeof(Graph)); after run Editor trigerred calls serialization/deserialisation for each graph in every Reload Domain!
              When I commented it, time to Reload Domain decrease from 14 second to 2.5 seconds for my graphs set.

              #15417
              Gavalakis
              Keymaster

                Hello,
                Thank you for the information. I will look at this and see how/if it can be avoided.

              Viewing 6 posts - 1 through 6 (of 6 total)
              • You must be logged in to reply to this topic.