Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance drop with multiple split node output #4589

Open
EnricoBeltramo opened this issue Mar 3, 2024 · 2 comments
Open

Performance drop with multiple split node output #4589

EnricoBeltramo opened this issue Mar 3, 2024 · 2 comments

Comments

@EnricoBeltramo
Copy link

Current Behavior

I've seen that if I have a node that has a large output size (e.g. a large array), when I split the output across multiple nodes there is a major performance hit, even if the other nodes aren't using the data

Expected Behavior

I expected that a simple forward of data in the flow doesn't have a so significant impact to flow execution.

Steps To Reproduce

Create a node that output a big sized data (e.g. a image), and connect it to multiple nodes

Example flow

paste your flow here

Environment

  • Node-RED version: 3.1.3
  • Node.js version: 20.9.0
  • npm version: 10.2.3
  • Platform/OS: Ubuntu
  • Browser: Chrome
@hardillb
Copy link
Member

hardillb commented Mar 3, 2024

Please supply an example flow that demonstrates the problem,

But assuming you mean having 2 (or more) output wires to different nodes then the whole message needs to be cloned before being forwarded, this is to ensure that modifications made on each downstream path do not change the msg object in the other path.

If the message contains a large array then it will take time to make this clone.

This is working as intended, pull requests to increase the performance of deep object copies will always be appreciated.

@dceejay
Copy link
Member

dceejay commented Mar 3, 2024

Yes - as Ben says, splitting a flow involves cloning the message for each separate output wire. - So if possible don't do it if you are handling large objects. Can the operations be handled in series rather than parallel ? etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants