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

Use binary search in insertToPriorityArray #17444

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

Conversation

filipsobol
Copy link
Member

@filipsobol filipsobol commented Nov 12, 2024

Suggested merge commit message (convention)

Fix (utils): Use binary search in insertToPriorityArray for better performance when handling big tables.


Reduces the time needed to render a table in the tableHuge test by ~67%.

@filipsobol filipsobol changed the title Use binary search in insert to priority array Use binary search in insertToPriorityArray Nov 12, 2024
scofalik
scofalik previously approved these changes Nov 15, 2024
packages/ckeditor5-utils/src/inserttopriorityarray.ts Outdated Show resolved Hide resolved
@scofalik
Copy link
Contributor

I think this change is safe enough to merge it into upcoming release @Witoso

@Witoso
Copy link
Member

Witoso commented Nov 15, 2024

Good for me 👍 another good reason to bump the version!

@niegowski
Copy link
Contributor

Does it affect the order of event listeners on the same priority? Until now, if there were multiple listeners on the same priority, then the order of registration was used. Does this PR change this?

@filipsobol
Copy link
Member Author

Does it affect the order of event listeners on the same priority? Until now, if there were multiple listeners on the same priority, then the order of registration was used. Does this PR change this?

No. You can test the previous and current implementation on the following playground by running the node index.js command in the console: https://stackblitz.com/edit/stackblitz-starters-86xsef

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.

4 participants