Hacker News new | ask | show | jobs
by hertog 5569 days ago
I understand what you are saying, but I thought that it wouldn't matter for browsers on mobile devices. I thought that the performance on a mobile device was slow enough to ignore the setInterval limit. Apparently not, since your test gives me a 200fps on my iPhone 3Gs.

However, although the fps is higher, the animation looks worse. Is that because the 'render cycle' is not completed using this technique?

2 comments

It's because browsers render in memory and then periodically update the video display with a "snapshot" copy. Typically this method is fine for the regular content of an average webpage.

But with zeroTimeout, the movement is happening so fast that the snapshot copy is behind. The browser might be only updating the video every 20ms at the fastest, while the block is moving several pixels every few ms.

But be assured the render of the block is completely happening and then being erased. It's a proper render. If it wasn't, you'd get a permanent "smear" of the results in the browser.

Just for "fun" I tried (abusing) the blaze.io screencapture service but it's snapshots unfortunately are way too slow

iphone 4.3 http://www.blaze.io/mobile-report/video/110315_1413/110315_1... (mp4)

android 2.3 http://www.blaze.io/mobile-report/video/110315_1414/110315_1... (mp4)