-
Notifications
You must be signed in to change notification settings - Fork 199
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
IE11 / Edge performance issues with using attribute selectors #339
Comments
@AaronW9090 I would like to know more about the perf issue. Do you mean
Even though I am not using attributed-based version (i.e. |
@compulim If your elements don't have the [data-css-xxx] attribute then even if those selectors appear in your stylesheet you shouldn't have these perf issues (although I haven't tested this). |
Hi all, this appears to be a known issue with Edge which we're working on: https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/13348719/ In the meantime, it may be advantageous to look into using classes instead of attributes. Classes should be faster than attributes in all engines, and particularly faster in Edge/IE. In general, most engines have optimized more for classes and IDs than for attributes. I also advised Svelte to do the same FWIW: sveltejs/svelte#1118 |
Hi,
I have been using glamor to help build a medium sized application and when testing in IE and Edge I noticed a major performance issue when hovering over elements with the ':hover' pseudo-selector OR hovering over their parent element. After many hours of debugging and one helpful medium article I discovered that the issue is caused by IE recalculating layout for almost every element on the page when using attribute selectors.
The first screenshot is with the '[data-css-*]' attribute selector:
The second screenshot is after removing those selectors from my stylesheet:
As you can see at a minimum the browser spent 65x less time calculating layout without the [data-css-*] selectors...
This is quite an extreme example as I am testing in a VM on a development build but using the reasonably powerful 2017 surface studio I was still getting ~350ms of layout calculation on every hover event.
I know the feature to opt-out of using those attribute selectors is on the backlog however I'm not sure if you are aware of exactly the performance impact they have on IE and Edge browsers, as this makes glamor basically unusable for even a medium sized application.
Cheers
The text was updated successfully, but these errors were encountered: