Super-slow editing large graphs

Forums 💬 FlowCanvas ⚙️ Support Super-slow editing large graphs

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #21884
    soulburner
    Participant

      Hi again. We bumped into the issue when it is VEERY hard to edit large graphs. Every moving a block, even panning takes very long. Something like 1 FPS.

      I’ve profiled the editor and found that it serializes the graph each redraw.

      #21887
      Gavalakis
      Keymaster

        Hello again,

        This can happen only in the case when a gameobject with the FlowScriptController component is selected and currently in the Unity inspector.
        This is basically due to the fact that Unity calls “OnBeforeSerialize” on every editor frame when an object is in the inspector. (I never understood why).

        The graph editor itself on the other hand should not serialize per frame by any means. Thus, if you deselect the gameobject from the Unity inspector (select something else) and keep editing your graph, things should go back to normal.

        I think the fact that Unity calls OnBeforeSerialize per frame is very weird, but maybe I can come up with a hacky workaround solution to not let that happen.

        Thanks for reminding me of this!

        #21886
        soulburner
        Participant

          [quote quote=1889]Hello again,

          This can happen only in the case when a gameobject with the FlowScriptController component is selected and currently in the Unity inspector.
          This is basically due to the fact that Unity calls “OnBeforeSerialize” on every editor frame when an object is in the inspector. (I never
          understood why).[/quote]
          That is definately not the case. I have none gameobjects with attached flowscripts (I load all flow scripts in runtime from resources).

          [quote quote=1889]The graph editor itself on the other hand should not serialize per frame by any means. Thus, if you deselect the gameobject from the Unity inspector (select something else) and keep editing your graph, things should go back to normal.

          I think the fact that Unity calls OnBeforeSerialize per frame is very weird, but maybe I can come up with a hacky workaround solution to not let that happen.

          Thanks for reminding me of this![/quote]

          By the way, if I run the application (Unity is in a play mode), the graph editor works smoothly.

          PS: I found that! You don’t need to select the gameobject with attached script on the scene. Selecting the script asset in the project is enough to make it work very slow. So, for now, I can select for example a folder after opening a script from the project. Thanks! That will help me a LOT.

          #21885
          Gavalakis
          Keymaster

            Sorry for the very late reply (I was on a small vacation) and thanks for the follow up!
            Indeed, even having the asset itself selected does produce this same problem. Once again it is due to how Unity calls OnAfterDeserialize on every frame when a “Unity Object” is selected and currently in the inspector, something that I will have to possibly hack-around to avoid.

            Thanks!

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