Poor performance

FlowCanvas Forums Support Poor performance

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1714
    Rami
    Participant

    We are getting pretty poor performance in the node editor when the total amounts of nodes reach above ~50.
    Looking at the profiler it seems as that the graph is serialized every frame, any specific reason why it needs to do it? Feels like it should only be necessary to serialize the graph is a change has been made to ports, connections or nodes.

    Attachments:
    You must be logged in to view attached files.
    #1716
    Gavalakis
    Keymaster

    Hello again Rami and sorry for the late reply.

    The graph IS serialized only when a change is made, except for one occasion, and that is when the graph asset is selected and thus it’s inspector is drawing.

    That might sound weird, but the reason behind this, is that Unity force calls the ‘OnBeforeSerialize’ method in every editor frame update when an object’s inspector is shown.

    If you deselect the graph (or simply select something else for example), you will notice that the graph will no longer serialize every frame and you will not any longer encounter these performance hits.

    Thanks!

    Join us on Discord: https://discord.gg/97q2Rjh

    #1717
    Rami
    Participant

    Not sure if I misunderstood what you meant but deselecting the asset in did not solve it for me. I checked the profiler and still Serializes the graph every time regardless of what Graph I have opened and what asset I have selected.

    #1718
    Gavalakis
    Keymaster

    Hmm. Can you please post for me the full screenshot from the profiler, so that I can see where the start of the call is happening?
    Thanks in advance.

    Join us on Discord: https://discord.gg/97q2Rjh

    #1719
    Rami
    Participant

    I was mistaken, but still some weird behaviour. It seems as if a graph will be serialized if I have it selected as you said, but it does not have to be opened. If I selected an empty graph and had my heavy graph opened, serialization did not happen every frame, but if I selected a different graph that also had a lot of nodes in it, serialization happened every frame.

    Attachments:
    You must be logged in to view attached files.
    #1723
    Gavalakis
    Keymaster

    Hello again Rami.

    Sorry for late reply.
    Yes, it does not matter which graph is open for editing. The only thing that matters (as far as the continous serialization), is which graph asset is selected in the project for inspection.

    Once again, the fact that Serialization callback is called every frame when an object is selected, is a Unity thing which I don’t know why they decide to do it.

    The workaround is simply, to not have a graph asset object selected. You can still of course have the graph open in the node editor to edit as you desire.

    Thanks.

    Join us on Discord: https://discord.gg/97q2Rjh

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