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

Find By Id Performance Enhancement with Map #1895

Open
dhdnjswnd opened this issue Mar 3, 2025 · 1 comment
Open

Find By Id Performance Enhancement with Map #1895

dhdnjswnd opened this issue Mar 3, 2025 · 1 comment

Comments

@dhdnjswnd
Copy link

I draw large amount of objects which is more than 50,000.
And I also try to edit them interactively.
I found out it is really slow when I'm looking for a specific element.
(Plz let me know if you have another way to search an element)
(I cached groups to improve performance.)

It is caused by the way Container handle their children.
They find an element in DFS way.

How about handling children in two ways?

Of course, I should change all functions, like remove, add, delete.

`export abstract class Container<
ChildType extends Node = Node

extends Node {
children: Array = [];
/// plus mappedChildren: Map<String, ChildType> = new Map<String, ChildType>();
`

stage

  • layer
    • group -elements
    • group -elements
    • group -elements
@lavrton
Copy link
Member

lavrton commented Mar 3, 2025

Did you try to run profiler? What exactly is slow? Rendering? Search by id? Something else?

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

2 participants