-
Notifications
You must be signed in to change notification settings - Fork 168
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 UIDL generation when scrolling through large grids #13745
Comments
pepijnve
added a commit
to pepijnve/flow
that referenced
this issue
May 12, 2022
…tionController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes vaadin#13745
9 tasks
pepijnve
added a commit
to datadobi/flow
that referenced
this issue
May 12, 2022
…tionController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes vaadin#13745
pepijnve
added a commit
to datadobi/flow
that referenced
this issue
May 12, 2022
…tionController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes vaadin#13745
taefi
added a commit
that referenced
this issue
May 19, 2022
…tor (#13746) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
vaadin-bot
pushed a commit
that referenced
this issue
May 19, 2022
…tor (#13746) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
vaadin-bot
pushed a commit
that referenced
this issue
May 19, 2022
…tor (#13746) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
vaadin-bot
pushed a commit
that referenced
this issue
May 19, 2022
…tor (#13746) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
vaadin-bot
pushed a commit
that referenced
this issue
May 19, 2022
…tor (#13746) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
vaadin-bot
pushed a commit
that referenced
this issue
May 19, 2022
…tor (#13746) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
mshabarov
added a commit
that referenced
this issue
May 20, 2022
…tor (#13746) (#13814) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]> Co-authored-by: Pepijn Van Eeckhoudt <[email protected]> Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
mshabarov
added a commit
that referenced
this issue
May 20, 2022
…tor (#13746) (#13818) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]> Co-authored-by: Pepijn Van Eeckhoudt <[email protected]> Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
mshabarov
added a commit
that referenced
this issue
May 20, 2022
…tor (#13746) (#13815) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]> Co-authored-by: Pepijn Van Eeckhoudt <[email protected]> Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
mshabarov
added a commit
that referenced
this issue
May 20, 2022
…tor (#13746) (#13816) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]> Co-authored-by: Pepijn Van Eeckhoudt <[email protected]> Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
mshabarov
added a commit
that referenced
this issue
May 20, 2022
…tor (#13746) (#13817) * fix: Avoid potential slow Set#removeAll call in HierarchicalCommunicationController#passivateInactiveKeys The performance of calling Set#removeAll(List) is dependent on the relative sizes of the Set and List parameter. Replace Set#removeAll with List#forEach(Set::remove) to avoid this. Fixes #13745 Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]> Co-authored-by: Pepijn Van Eeckhoudt <[email protected]> Co-authored-by: Mikhail Shabarov <[email protected]> Co-authored-by: Soroosh Taefi <[email protected]>
This ticket/PR has been released with Vaadin 23.1.0.rc1 and is also targeting the upcoming stable 23.1.0 version. |
This ticket/PR has been released with Vaadin 23.0.11. |
This ticket/PR has been released with Vaadin 22.0.16. |
This ticket/PR has been released with Vaadin 14.8.13. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description of the bug
HierarchicalCommunicationController#passivateInactiveKeys
callsremoveAll
on anAbstractSet
implementation passing in a aList
. This implementation ofremoveAll
compares the size of the set with the size of the collection parameter. If the set is larger than the collection, it loops over the collection and callsremove
in a loop. In the other case, it iterates over the set, callscontains
on the collection for each item, and then callsIterator.remove
. This second code path leads to very poor performance whenpassivateInactiveKeys
is called with fairly large collections sinceList#contains
has to do a linear search for ever item in the Set. Worst case scenario this isO(n * m)
in time complexity. It's significant enough to show up as a 25% hotspot during profiling.Expected behavior
O(n * m)
code paths are avoided.Minimal reproducible example
I noticed this while testing our application with a TreeGrid contains about 10k rows and scrolling up and down rapidly.
Versions
The text was updated successfully, but these errors were encountered: