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

[feature request] Optimize for multiple selectors in one pass #1463

Open
ftaiolivista opened this issue Jan 14, 2025 · 0 comments
Open

[feature request] Optimize for multiple selectors in one pass #1463

ftaiolivista opened this issue Jan 14, 2025 · 0 comments

Comments

@ftaiolivista
Copy link

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?

@ftaiolivista ftaiolivista changed the title [feature request] Multiple selectors [feature request] Optimize for multiple selectors in one pass Jan 14, 2025
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

No branches or pull requests

1 participant