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

feat: improve performance during "DelegatingNode#reorder()", by calculating indices of properties once #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

wglanzer
Copy link
Member

@wglanzer wglanzer commented Nov 3, 2024

No description provided.

@wglanzer wglanzer requested a review from jboesl November 3, 2024 20:12
@wglanzer wglanzer self-assigned this Nov 3, 2024
executeWriteOnDelegate(pDelegate -> pDelegate.reorder(Comparator.<IProperty>comparingInt(p -> children.indexOf(p.getDescription())), pAttributes));
executeWriteOnDelegate(pDelegate -> {
// extract indices from the current children first, to improve performance on large models
Map<IPropertyDescription<?, ?>, Integer> childrenIndices = new HashMap<>();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe set the size for the map on creation to prevent resizing

Copy link
Member

@jboesl jboesl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add the size of the map. Beside that change looks good.

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.

2 participants