[PERFORMANCE] The wire behind Node.elapsedTime.

Forums 💬 NodeCanvas ⚙️ Support [PERFORMANCE] The wire behind Node.elapsedTime.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #15890
    driiade
    Participant
      Hi I copied/pasted my message on the discord just to better follow it. There is so much performance lost behind Node.elapsedTime Firstly it require to know when a Node start running, so the variable Node.status is a getter/setter with an if in it (big performance cost) for having the time it begin to run. After deleting the getter/setter of status you go to second point => Secondly, GraphAssignable require getter for status variable. It require it just because you want to TryReadMappedVariables(); at end of subgraph execution. BUT you already can have it by adding a callback each time you call it in a IGraphAssignable (and so deleting an if in bool TryStartSubGraph(this IGraphAssignable assignable, Component agent, System.Action<bool> callback = null). And finally, this elapsed time serve only for ? Timeout Condition, and this condition is wrong if you play the subGraph on FixedUpdate (because Node.Update() doesn’t have the good deltaTime as parameter)
      #15891
      Gavalakis
      Keymaster

        Hey,

        There are always optimizations that can be made in code. Always
        However I prefer to focus on more important optimizations that one or two if statements 🙂 I will take a look at the points you mentioned here. For certain, TryReadMappedVariables specifically does need some optimization.

        Thanks!

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