Lag when runtime Load

Forums 💬 NodeCanvas ⚙️ Support Lag when runtime Load

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #18123
    jabi6
    Participant

      hi.

      A lag occurs when loading at runtime.
      I want to know how to solve this.

      The load flow is as follows.

      In Galaxy s5, it takes 1 ~ 2 seconds to load 6 prefab objects shown below.
      It’s a very deadly time in our game.

      The load flow is as follows.

      case 1.
      -1. GameObject test = resources.load(“MyCharacter Prefab”).Instantiate();
      -2. test.Awake()
      -3. GraphOwner.cs : (Awake() -> GetInstance -> Deserialize) * 6 times

      case 2.
      -1. bind graph
      -2. GameObject test = resources.load(“MyCharacter”);
      -3. GraphOwner.cs : Awake()
      -> if (graph.hideFlags == HideFlags.HideInInspector) : false
      -> GetInstance -> Deserialize
      -> 6 times

      Preloading objects at loading time is fine.
      However, this also only adds 1 to 2 seconds to the loading time.

      The objects loaded in the Prefab by the method of Case 2 are “hideFlags” none.
      Is it dangerous to force this to be “Hideınspector”?

      I want to know a good solution.

      #18128
      Gavalakis
      Keymaster

        Hello,

        Thanks for the detailed report.

        Regarding the hideFlags check, it should not be modified in the source code, since it is required for determining whether a graph is bound or not and thus act accordingly (even though this check has already been changed for the next version).

        Deserialization of graphs is obviously having a performance impact due to GC allocation (that can’t be avoided), but there should be no problem if the gameobjects are pre-loaded in load time. Certainly not the same impact as when instantiating and deserializing on-the-fly.
        Are you saying that preloading the gameobjects at load time instead of instantiating them on-the-fly, still occur in a performance impact?

        Let me know.

        (PS: I hope I did not misunderstood your questions)

        #18127
        jabi6
        Participant

          Thank you for a good reply.

          I’m going to ask you a few more questions.

          Regarding the hideFlags check, it should not be modified in the source code, since it is required for determining whether a graph is bound or not and thus act accordingly (even though this check has already been changed for the next version).
          -> Is it true that “HideFlag” is set to “None” even when the bound graph is loaded into the Prefab?
          This causes “case 1” and similar loading times to be consumed.

          Deserialization of graphs is obviously having a performance impact due to GC allocation (that can’t be avoided), but there should be no problem if the gameobjects are pre-loaded in load time.
          -> 1. Pools the object.
          2. Load this object six times.
          3. Is it appropriate to have six deserializations?
          4. Is it correct to be like the attached picture?

          #18126
          jabi6
          Participant

            bump..

            #18125
            Gavalakis
            Keymaster

              Hello again,

              Please let me address your questions:

              1) Yes, the graph object HideFlags is set to “None” if the graph is part of a prefab owner, even if it is a bound one (because it becomes a sub-asset of the prefab)

              2) Yes, each graph needs to be deserialized separately, since a “deep clone/copy” of each graph is required for each instance, so the screenshot looks correct.

              Thanks.

              #18124
              jabi6
              Participant

                Thank you for a good reply.

                Cheer up

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