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

Faster DOM rendering when processing toolbar filters #3845

Merged
merged 5 commits into from
Nov 19, 2024

Conversation

atodorov
Copy link
Member

No description provided.

by collecting a list of DOM selectors to be queried/shown via jQuery
multiple-selector at the same time instead of calling .show() for each
one of them.

For 1-2 rows this is on-par with the previous implementation, however it is
around 2x faster when the result set contains many rows (say 100 or
1000).

WARNING: when a result set contains hundreds of rows there is still a
noticeable lag on the page. For example if filtering 1000 rows for
is_automated=false, where only 10 rows have the value of True and the
rest 990 have the value of False!

See https://api.jquery.com/multiple-selector/
building upon the previous change we now either show or hide rows on
screen depending on what the actual result set is.

When the rows which match the filter are less than the ones which don't
we display only them. Else we display everything and hide the rows which
don't match the filter. This always results in the minimum number of
display updates.

For the extreme scenario where 990/1000 rows match is_automated=false this
provides 30x improvement!

WARNING: for scenarios which are not on the extreme case, yet still
result in 100s of rows that need to be displayed this commit does not
offer any optimization compared to the previous one!
@atodorov atodorov force-pushed the faster_dom_rendering_for_filters branch from 7b7bf96 to 7d31a59 Compare November 18, 2024 10:46
@atodorov atodorov marked this pull request as ready for review November 19, 2024 11:02
@atodorov atodorov merged commit 25aa4c9 into master Nov 19, 2024
40 of 46 checks passed
@atodorov atodorov deleted the faster_dom_rendering_for_filters branch November 19, 2024 11:03
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.

1 participant