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

Performance of JSS.combineSelectors() is poor #234

Open
src-code opened this issue Jul 30, 2015 · 0 comments
Open

Performance of JSS.combineSelectors() is poor #234

src-code opened this issue Jul 30, 2015 · 0 comments
Labels
enhancement package/atomizer Issues for atomizer package

Comments

@src-code
Copy link
Contributor

From @3den in pr #233:

Problem: extracted seems to be an array of objects, the challenge we have is to find the keys that map to the same value in order to create the selector and to do that we take current O(n^2).

Suggestion: we can think about this as an inverted hash where the key is the style we are applying and the value is an array of selectors that match that value every time you find a new selector we just push it to the corresponding style, the object could look something like:

{
   'display: inline-block;': ['.D\(ib\)', '.IbBox', 'a[class*=LineClamp]']
}

ps: I don't know if that suggestion would work better so fell free to ignore it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement package/atomizer Issues for atomizer package
Projects
None yet
Development

No branches or pull requests

2 participants