JS-animated SVG not smooth
Reported by
t...@tobireif.com,
Jun 3 2018
|
|||||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36 Steps to reproduce the problem: 1. Open https://tobireif.com/non_site_stuff/just-a-perf-test-animated-fork-of-my-snake-pattern-in-svg/ 2. Observer the framerate. What is the expected behavior? The framerate should always be at 60fps, without any hiccups. What went wrong? Sometimes the framerate is below 60fps, and sometimes there are frequent hiccups. In an addition, please also check the same page https://tobireif.com/non_site_stuff/just-a-perf-test-animated-fork-of-my-snake-pattern-in-svg/ on a smartphone (eg in the latest Chrome on a Galaxy S7). Did this work before? N/A Does this work in other browsers? N/A Chrome version: 66.0.3359.181 Channel: n/a OS Version: OS X 10.13.5 Flash Version: I hope that the general performance of JS-animation (eg JS-animated SVG) can get improved.
,
Jun 3 2018
,
Jun 4 2018
Unable to reproduce the issue on reported chrome version 66.0.3359.181 and latest chrome 67.0.3396.62 using Mac 10.13.3. Attaching Screencast for reference. Steps -------- 1. Launched Chrome. 2. Navigated to given URL ""https://tobireif.com/non_site_stuff/just-a-perf-test-animated-fork-of-my-snake-pattern-in-svg/"" 3. Opened Dev tools and Enabled frame rate Observed frame rate on below 60fps and observed rendering normally. @Reporter: Could you please review the attached screen-cast and confirm if anything being missed here and could you please upgrade your chrome browser and let us if the issue still persists also If this is consistently reproducible then suspecting this could be specific to Mac OS X 10.13.5. You can download latest chrome builds here: "https://www.chromium.org/getting-involved/dev-channel". Thanks!
,
Jun 4 2018
The test in comment #3 does show a frame rate mostly at 30fps but sometimes dropping 1 frame and sometimes getting in an extra frame. So it is a bit choppy. M-67 on linux looks completely smooth, and it's smooth in Canary on a Pixel 2. Is this actually worse than it was before?
,
Jun 4 2018
Thanks for investigating! > Is this actually worse than it was before? Sorry, I don't know. I think it always has been like that in Chrome on MacOS. Also, there's great variation: eg I might get a framerate in the 30s or 40s, then a after a reload the framerate might be in the 50s. (each with many hiccups / drops in the framerate-curve / not-always-smooth animation) > The test in comment #3 does show a frame rate mostly at 30fps but sometimes dropping 1 frame and sometimes getting in an extra frame. So it is a bit choppy. I hope it can be ensured that the framerate always is 60fps, and constantly smooth (without any pauses/hiccups). That would be great!
,
Jun 4 2018
(It also is significantly non-smooth in Canary, even with the dev tools closed.)
,
Jun 4 2018
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Jun 4 2018
By the way, the demo uses GSAP https://greensock.com/tweenmax , a popular JS-animation library.
,
Jun 4 2018
This will probably have to wait for an organic fix. There's nothing much specific we can do here, although the test case is helpful.
,
Jun 4 2018
Profiling seems to suggest that the main bottleneck is style-recalc followed by CSS parsing [1] - which doesn't seem too unexpected considering what it is doing. So it's largely of the "1000 needles" (overhead that accumulates) kind. I noted one weird thing when looking at some profiling data, but it only accounted for ~1% of the runtime in the data I collected. [1] Looks like TweenMax could be slightly more efficient here by using a more suitable transform function (rather than matrix3d) to save some on parsing. I only looked at the minified code though. Typed OM could possibly help oo. Probably not a whole lot to save there though.
,
Jun 8 2018
"Profiling seems to suggest that the main bottleneck is style-recalc followed by CSS parsing [1] - which doesn't seem too unexpected considering what it is doing. So it's largely of the "1000 needles" (overhead that accumulates) kind." So there's no room for significant performance optimization? I hope there is 😀 Would it be one potential measure to utilize the GPU? (respectively to use it more?) PixiJS uses the GPU (WebGL). When I keep clicking this demo https://www.goodboydigital.com/pixijs/bunnymarkfull/ I can go to over 10000 bunnies before the framerate drops to below 60fps. I hope that JS-animated SVG can be that fast in Chrome.
,
Jun 9 2018
Since the bottleneck isn't rasterization, GPU-raster won't make a significant difference. Rasterization is probably in fairly decent shape for this case even. I certainly wish style-recalc wasn't the bottleneck - and I do hope that _something_ can be done about in due time. My experience with optimizing "overhead" like this is that difficult and tedious though. (And in a code-base like Blink might even be sisyphean task.)
,
Jun 18 2018
The NextAction date has arrived: 2018-06-18
,
Jul 2
"I do hope that _something_ can be done about in due time" Me too! JS-animation is the most powerful animation option there is, and SVG is a hugely powerful vector graphics format, so it's important that the combination works smoothly. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by t...@tobireif.com
, Jun 3 2018732 KB
732 KB View Download