You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Let's assume we want search elements using many CSS selectors.
We can do it in O(n) simply joining them in a single selector ", , ,..." and calling selectAll one time.
But what if we want to know which selector have selected the found nodes?
We can search every selector calling selectAll multiple times, but we get O(k*n) i think (not expert).
Or we can call the matches() function against every found element for every selector to find the right one. Probably this will be more performant then do selectAll many time, but still do duplicated work.
Instead would be great if selectAll could return, in addition to found elements, which selector apply to each found element, maybe as an option.
What do you think?
The text was updated successfully, but these errors were encountered:
ftaiolivista
changed the title
[feature request] Multiple selectors
[feature request] Optimize for multiple selectors in one pass
Jan 14, 2025
Let's assume we want search elements using many CSS selectors.
We can do it in O(n) simply joining them in a single selector ", , ,..." and calling selectAll one time.
But what if we want to know which selector have selected the found nodes?
We can search every selector calling selectAll multiple times, but we get O(k*n) i think (not expert).
Or we can call the matches() function against every found element for every selector to find the right one. Probably this will be more performant then do selectAll many time, but still do duplicated work.
Instead would be great if selectAll could return, in addition to found elements, which selector apply to each found element, maybe as an option.
What do you think?
The text was updated successfully, but these errors were encountered: