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

Slow performance in populateTargets findParent #1062

Open
dermitzos opened this issue Feb 4, 2025 · 0 comments
Open

Slow performance in populateTargets findParent #1062

dermitzos opened this issue Feb 4, 2025 · 0 comments

Comments

@dermitzos
Copy link

dermitzos commented Feb 4, 2025

We are using the community edition of jsPlumb to create graphs with a large amount of elements. These elements have multiple source & target selectors.

When starting a new connection because of the multiple targets and the amount of parents, it's really slow to find the element that the target is referring to. You can see an example of the delay here.

Could we add an optional field for the source/target elements where we could provide the parent ID in an attribute (something like data-jtk-parent-id) and in the populateTargets if this attribute is present, get the parent using document.getElementById(el.getAttribute('data-jtk-parent-id')) ?

From my tests, in our implementation this improves the performance dramatically, where the time to findParent at first is ~3000ms in certain cases and using this implementation the time reduces to 35ms.

I can provide an example/PR of the implementation too if needed

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

No branches or pull requests

1 participant