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 Improvement: Enhancing Web UI Rendering Speed for "showDragLines" #4594

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

fullmooooon
Copy link

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Proposed changes

This PR focuses on optimizing the performance of the showDragLines feature in the web UI, resulting in a significant improvement of approximately 2x. Through testing on Edge DevTools performance page, it was observed that the "Long Task" duration for a Node-RED flow page containing 800 nodes decreased from around 90ms to 50ms. This translates to an increase in frame rate from approximately 11 frames per second to 20 frames per second.

I am not sure why these few lines of code I have modified are effective. My changes probably have no side effects

Checklist

  • I have read the contribution guidelines
  • For non-bugfix PRs, I have discussed this change on the forum/slack team.
  • I have run npm run test to verify the unit tests pass
  • I have added suitable unit tests to cover the new/changed functionality

Copy link

linux-foundation-easycla bot commented Mar 6, 2024

CLA Signed


The committers listed above are authorized under a signed CLA.

@knolleary
Copy link
Member

Hi @fullmooooon - thanks for this.

Your changes causes it to bypass redrawing the view whilst dragging new links around. So whilst it is doing less work, it does now mean some updates aren't happening that should.
For example, with the link nodes, you can see here (just about... assuming the gif compression doesn't hide it...) when I start to drag a link, the circle port on the right-hand link node appears as a target for the link:

FZqAML5nsE

That only works if _redraw() gets called to refresh the node appearance.

So whilst I'm sure there are optimisations to be had, I think this one is maybe a bit too simple.

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

Successfully merging this pull request may close these issues.

None yet

2 participants