Hacker News
points by pwagland 3 days ago | 0 comments
Interesting experiments and differences between the browsers.

Using the test: (async () => { const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); for (let i = 0; i < 200; i++) { __walker.add(); await sleep(10); } })();

From the JavaScript console, on both Chrome and Safari.

The animation is _way_ smoother on Chrome, but scrolling on that page becomes really painful.

Safari, on the other hand, uses a lot more CPU to do the animation, and the FP of that animation drops dramatically as you change the number of lemmings from 10 -> 50 -> 100 -> 200. However scrolling the page remains smooth the entire time.

[–] WorldMaker 2 days ago
Page response might be smoother in both if the script switched from `setInterval` to `requestAnimationFrame`.
Hacker News