-
Notifications
You must be signed in to change notification settings - Fork 82
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
Huge delay when using ally.maintain.disabled #142
Comments
Received the link, will have a look on Saturday :) |
I've received the URL of the staging site and taken a quick peek. It seems like we're spending ~3 seconds in layout. But with ~600 DOMElements this site is not exactly huge. Because this only happens on an empty cache, the reason is likely to be found in the supports tests. If you were to add the source map ( |
I've spent some more time looking at the timeline of opening the menu. When the menu is first opened, ally.js runs it's supports tests. Using detect-focus.js an test like focus-invalid-tabindex will do the following steps:
This process is repeated for 20+ tests. Each test will flush the layout buffer (internal browser optimization) 4 - 6 times. That's mainly due to reading and writing Because one recalculation of style takes around 25ms, we end up with around 2.7 seconds of calculating styles (25ms * 5 flushes * 22 tests). I've never noticed the impact Originally I though splitting the tests up into individual files and only running them when required was a good idea. After looking at the timeline's flamechart I'm not so sure anymore. If we run all ~30 tests in a row, we'd reduce the number of style calculations caused. Simply by running the scroll position reset only once and potentially a single I wonder what happens if we run the tests in a temporary iframe. That should decouple all of this from the page's styles and make sure that we can't run into the situation you're facing now. All that said, you should still try to figure out why Chrome needs 25ms to recalculate styles on that site. |
Thanks for having such a detailed look into this. Do you still want me to add the So is 25ms a lot to recalculate styles? Edit: I replied before I looked into how to analyse slow recalculation. I'm not expecting an easy fix, there are a lot of styles on the site. I'll have to look into it. Thanks |
If you want to check out the timeline yourself, that would help. I've reproduced the problem outside of your project, so I don't need it anymore.
Yes.
Good Luck! |
I've implemented the refactorings (all tests in one go to reduce number of layouts, run tests in iframe to reduce impact of layout) in refactor/142-supports. I've run into an issue with [Intern, BrowserStack, IEDriver] causing a single test to fail on IE10. This failing test is currently keeping me from merging the improvements. The problem is being analyzed by the BrowserStack support. Once they get back to me I'll merge this provide create a beta release. @mikeebee regarding your page I'm inclined to recommend you not use |
Ok, no worries. Thanks for the help! |
I'm sorry for the insane delay. BrowserStack didn't get back to me with a solution to the failing test. I disabled the failing test for IE10 (as this clearly is a WebDriver problem, not an issue of the ally.js code) and merged the refactored code. You can test the results of build 552. |
I'm using
ally.maintain.disabled
on multiple off canvas elements, when I open any of them it takes ~3 seconds to open. If I remove Ally they are fine.This only happens with clear cache and once one is opened they are all fine.
I can't imagine it's related but the network tab shows that a data svg image is missing.
I have a link to a staging site with the issue but I can't publish it. I have sent you it direct.
The text was updated successfully, but these errors were encountered: