Graph. Deserialize too much time consuming.How to optimize it?

Forums 💬 NodeCanvas 🗨️ General Discussion Graph. Deserialize too much time consuming.How to optimize it?

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #13720
    unitycoyote
    Participant

      Hello, I have a question, I created a similar behavior of more than 40 node tree asset, when I dynamic loading role object, CPU time consuming in the Profiler and GC Alloc looks a little terror, I checked the time-consuming function, found to be appear in the Graph. Deserialize, Deserialize the json data is cost so much, how can change the status quo, please

      #13728
      Gavalakis
      Keymaster

        Hello,

        Initializing graphs and due to json deserialization, is definitely slow, but judging from your image it seems slower than it should generally be. Is it possible for you to send me the graph used so that I take a look at what types are serialized closer (support_AT_paradoxnotion.com) ?
        Also, it is generally a good practice to pre-load the graph related gameobjects at “load time” instead of instantiating them on the fly, since regardless of how much optimization I might be able to put into the json deserialization, it would never achieve no allocations.
        Once again, if possible, please do send me the graph used to support_AT_paradoxnotion.com so that I can see what can potentially be optimized.

        Thanks!

        #13727
        driiade
        Participant

          There is BJson for binary Json which is nice.
          Maybe an option for those who don’t care about to read the string ?

          #13726
          psykaw
          Participant

            Binary serialization seems to be a good feature, I really need it for my big project (some graph took 600ms to deserialize).

            #13725
            unitycoyote
            Participant

              [quote quote=13014]Hello,

              Initializing graphs and due to json deserialization, is definitely slow, but judging from your image it seems slower than it should generally be. Is it possible for you to send me the graph used so that I take a look at what types are serialized closer (support_AT_paradoxnotion.com) ?
              Also, it is generally a good practice to pre-load the graph related gameobjects at “load time” instead of instantiating them on the fly, since regardless of how much optimization I might be able to put into the json deserialization, it would never achieve no allocations.
              Once again, if possible, please do send me the graph used to support_AT_paradoxnotion.com so that I can see what can potentially be optimized.

              Thanks!

              [/quote]

              I am sorry that I have been busy with other functions of the project recently.Could you please leave your email? I will send you a copy of the demo.

              #13724
              unitycoyote
              Participant

                [quote quote=13037]Binary serialization seems to be a good feature, I really need it for my big project (some graph took 600ms to deserialize).

                [/quote]
                Is it a behavior tree that costs 600ms of deserialization time? How many tree nodes are there?

                #13723
                unitycoyote
                Participant

                  [quote quote=13034]There is BJson for binary Json which is nice.
                  Maybe an option for those who don’t care about to read the string ?

                  [/quote]

                  Do you have any Suggestions for optimization?

                  #13722
                  driiade
                  Participant

                    Some Json library have the option to serialize and deserialize with BJson (instead of string)

                    #13721
                    unitycoyote
                    Participant

                      [quote quote=13043]Some Json library have the option to serialize and deserialize with BJson (instead of string)

                      [/quote]

                      Thank you for your advice.

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