-
Notifications
You must be signed in to change notification settings - Fork 12
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
Chrome lags on cursor changes #275
Comments
Also a problem in ESPB during animation. |
Didn't find any issues in Chromium bug tracker. |
I found no direct solutions or workarounds, and didn't find any public reports of this in Chrome (Googling, or in the Chromium issue tracker). It seems that the style and layout computations are re-done even if we add an overlay meant just for the events. Notably in the screenshot below, this is triggering over all of the nodes in the SVG tree whenever the cursor changes. I'd highly recommend combining many line/path elements into a single path (see GridNode, GaugeNode), and minimizing the number of nodes (it's reflowing the invisible ones also). I see ToggleButtonDeprecated with 4 copies of things. The Scene when loaded in the 1st tab has ~1320 nodes in the tree (including all screens), so I'd recommend testing with the add/remove child for screens instead of visibility toggles to see if that helps. Also, we probably want to open a Chromium issue for this. |
I tried launching ESPB with ?standalone, and it seems like the problem reduced by about 70%, so I think @jonathanolson hypothesis is correct. This seems like another opportunity for WebGL to solve the problem, since there will be no reflows. |
Also, liberal use of Canvas for things that don't need to be redrawn often may also help improve this. |
Is there an easy way to get a DAG size from scenery? If that is an important performance measure, perhaps we should have a straightforward API to get it? |
One way to see the DAG (as a tree?) is by using |
Perhaps counting the lines in simScene.popupDebug() is a good way to "weigh" the scene graph. I see the following counts: 1305 lines in the original version. |
@jonathanolson any suggestion how to directly & automatically measure the dom reflow time using code? Or is the chrome developer tool the best way to do this? |
I just made a recursive function to count in the console, but I don't mind adding a function to Node to count. |
I don't know of any way besides checking in the dev tools to actually view it, I'd just qualitatively test performance. |
This should be reported to the Chrome team. |
I tested removing all of the svg elements from the otherwise webgl-rendered ESPB and the problem went away. So perhaps rendering things in WebGL could solve this problem. |
Chrome 38 came out today, and this problem just got a whole lot worse. 😞 |
This issue seems to go away if I get rid of everything except for the WebGL canvas (But I have to get rid of the navbar too). This suggests that going to WebGL could solve this problem, but we would have to use WebGL for the navbar as well as the sim screen. |
Please see tests/browsers/chrome-cursor-test.html. Reproduces the slowdown with just a static SVG state. |
@jbphet says: tested this in Arithmetic recently, and it may be worse with scenery 0.2. |
Timeline of FPAF shows that the cursor update triggers recalculation of styles (more expensive) and layout (less expensive). Compositing looks like a significant (dominating?) factor unless I'm reading the plot wrong (I'll read up on the tools a bit): We could consider some creative (hacky) ways of not triggering style recalculation but still changing the cursor (e.g. maybe creating divs for each cursor type and change their stacking order might work). Will probably need to bring back the original cursor toggling test page. |
#337 should help with this. |
Unable to reproduce the cursor issue on Chrome 45 (Win 7), anyone else (@pixelzoom, @samreid, @jbphet, @aaronsamuel137) noticed this in sims recently? |
I can't seem to reproduce it either. I remember a slight stutter in color-vision when the cursor changed and the photon view was present. Doesn't seem to happen anymore. |
I have never seen this issue. |
Can't reproduce on other platforms. Closing for now. |
FPAF and other sims show this.
The text was updated successfully, but these errors were encountered: