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] Strangely high CPU usage in Chrome when editing a display layout #1603
Comments
Thanks for reporting this. I'm able to reproduce locally; Did some initial investigation. Profiling didn't show any hotspots, and Based on fiddling with CSS, it seems like it's the pulsing animation Assigning to @charlesh88 to look at performance here. There's an approach for performant animated box shadows that doesn't translate exactly, but might be a decent starting point; basic idea is to use an ::after pseudo-element for the animated part, and animate the opacity on that to reduce the amount of actual redrawing that the browser (thinks it) needs to do. |
Also, @larkin / @charlesh88, does the "critical" designation seem right to you? This doesn't perceptibly impact performance in my dev environment, but the performance impact is steep enough that I could see this creating problems for users. |
@BogdanAlexandru great job reporting this. Critical, maybe not. We have to be very careful with keyframe animation-- they're not implemented well and generally cause browser repaints at 60hz which causes significant performance overhead. Especially when you consider there are many levels of transparencies and other calculations it's forcing for each frame for every item inside of the edit pane. I had mentioned this performance problem to @charlesh88 before and he was happy to drop the animation or replace with something different. It's good to get this issue opened and it should be a quick fix. |
Here's a good breakdown of the keyframe animation problems from when this was a problem in VSCode: microsoft/vscode#22900 |
Removed critical flag per above. Candidate fix: Render the border by animating the opacity of an |
Fixes #1603 from a performance perspective; not ready to merge due to unintended visual effects.
Thanks a lot for the quick response to this! 👍 It's very appreciated, the issue does hurt when I work in edit mode often, the UI is simply crawling. |
@BogdanAlexandru Was unaware of this issue about keyframing anims in CSS, thanks for bringing this up. @VWoeltjen, great pointer to a solution. There's other spots where I'm using keyframing, I'm going to look across the app and convert or remove. |
Fixes #1603 Remove keyframe anims from transition to edit mode and border-color anim in _messages.scss;
Testing notes:
|
commit 73e452e Author: Pete Richards <peter.l.richards@nasa.gov> Date: Wed Jun 21 14:56:51 2017 -0700 [Imagery] Update spec commit bbeb97e Author: Pete Richards <peter.l.richards@nasa.gov> Date: Wed Jun 21 14:21:51 2017 -0700 [Imagery] Use LAD query commit e6d65f3 Author: Pete Richards <peter.l.richards@nasa.gov> Date: Wed Jun 21 14:17:18 2017 -0700 [Example] Add historic, lad imagery providers commit 1ab4cf6 Author: Pete Richards <peter.l.richards@nasa.gov> Date: Wed Jun 21 13:56:18 2017 -0700 [example] 5 seconds per image commit 7fcaf65 Merge: 0713941 44246e6 Author: Pete Richards <pete@pete-richards.com> Date: Wed Jun 21 11:24:23 2017 -0700 Merge pull request #1614 from nasa/open1569 Fixed tabbing in overlay forms commit 0713941 Author: Victor Woeltjen <victor.woeltjen@nasa.gov> Date: Wed Jun 21 13:23:18 2017 -0500 [Time] Encode time settings in URL (#1620) * [Time Conductor] Skeleton class for URL handling #1550 * [Time Conductor] Scaffold in param handling * [Time Conductor] Finish sketching in URL handler * [Time Conductor] Usage correct constants for bounds * [Time Conductor] Use start/end for bounds/deltas * [Time] Move URL handler Per discussion, #1550 (comment) * [Time] Rename URL handler * [Time] Rename URL handler script * [Time] Use Time API from URL handler * [Time] Utilize Time API * [Time] Listen for changes, synchronize URL * [Time] Move URL handler into adapter ...as it uses Angular constructs. * [Time] Wire URL handler into adapter bundle * [Time] Pass correct constructor arguments to URL handler * [Time] Begin debugging URL handling * [Time] Clarify and correct logic for bounds/deltas in URL * [Time] Define timeSystem * [Time] Pass start/end into time API as numbers ...instead of strings. * [Time] Avoid creating redundant objects * [Time] Restructure fixed vs clock logic * [Time] Stop clock correctly for fixed mode * [Time] Fix hasBounds/hasDeltas logic ...given that both inputs will be strings when read from search params, _.isFinite was doomed to return false. * [Time] Check for complete information ...before updating Time API to reflect search state. Additionally, flatten logic to ease readability. * [Time] Begin testing TimeSettingsURLHandler * [Time] Test fixed mode query string updates * [Time] Test realtime mode query string updates * [Time] Test update of time API from query params * [Time] Add missing semicolons Satisfies JSHint; fixes #1550 commit 1d7d56d Merge: ba99418 61f59a9 Author: Pete Richards <pete@pete-richards.com> Date: Wed Jun 21 11:10:14 2017 -0700 Merge pull request #1613 from nasa/open1592 [Frontend] Fixed markup to allow scroll of results commit ba99418 Merge: d3b313d a8a689f Author: Pete Richards <pete@pete-richards.com> Date: Wed Jun 21 11:08:23 2017 -0700 Merge pull request #1612 from nasa/no-keyframe-anims Review and merge no-keyframe-anims branch commit 44246e6 Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Tue Jun 13 14:14:39 2017 -0700 [Frontend] Modified tabindex of search input Fixes #1569 commit 61f59a9 Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Tue Jun 13 09:24:42 2017 -0700 [Frontend] Fixed markup to allow scroll of results Fixes #1592 commit a8a689f Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Fri Jun 9 11:40:58 2017 -0700 [Frontend] WIP remove keyframe anims Fixes #1603 Remove keyframe anims from transition to edit mode and border-color anim in _messages.scss; commit c7787aa Author: Charles Hacskaylo <charlesh88@gmail.com> Date: Tue Jun 6 16:18:22 2017 -0700 [Frontend] WIP remove keyframe anims Fixes #1603 Remove keyframe anims from transition to edit mode
See this gif here: http://imgur.com/QAMfBoc
As soon as I start editing an empty display layout, the CPU usage in Chrome 58.0.3029.110 (64-bit) (latest at the time of writing) goes nuts and my laptop turns into a wind turbine.
Normally I wouldn't mind this that much, but the UI itself also ends up being very sluggish. For example, scrolling in the save as dialog shown in the gif feels unpleasant to say the least.
Quitting the edit process results in smooth performance once again.
It's been a while since I tried out a build of OpenMCT, a few months ago (around January) I'm almost 100% sure I used the same laptop for it and the bad Chrome behavior did not exist. I'm not sure if it also happens in Firefox, I've yet to try it out.
I'm going to investigate this as I continue work on my PRs, and come back with any other info I can spot. Let me know if you can't repro it, it could be local to my machine settings. No other machine available to test on my side atm.
Running it on Win 10 Home (updated to latest version), i5 6200U, integrated GPU.
The text was updated successfully, but these errors were encountered: