4 ms·
This is definitely not smooth on iOS, on a brand new iPhone that’s arguably way faster than whatever system played the original DVD screensaver. On a technical
by jsf01 6y ago
This is definitely not smooth on iOS, on a brand new iPhone that’s arguably way faster than whatever system played the original DVD screensaver.
On a technical note, not that there’s much you can do about this, but because you’re reading clientWidth and clientHeight each frame, you’re forcing reflow. A performant implementation would probably require avoiding the DOM altogether within the draw loop, so that would mean using canvas/webgl.
- dade_ 6y agoLooks great on my new iPad Pro, so I guess it was worth the money!
- ricardobeat 6y agoThere are no elements in the page for style to be recalculated, so I doubt the reflow is what's slowing it down. I'm curious on what could cause bad performance for you though. It runs smoothly at 60fps on an iPhone 11 and the iPad, using Safari. Did you open the standalone page at https://wwpzj.csb.app/ https://wwpzj.csb.app/? My only guess would be that the CodeSandbox UI is too heavy for mobile. For science, I went ahead and converted the code to ES3 and ran on the 10-year old first generation iPad (with setInterval) and it's still pretty smooth.
- dawnerd 6y agoNot smooth here either. Can tell it wants to but will hiccup every now and then.
- deleted 6y ago[deleted]