Hacker News new | past | comments | ask | show | jobs | submit login

> A friend pointed out offline that canvas rasterization (typically) is on the GPU, which is probably why my performance intuitions with my stuttering animation were so wrong

Did you solve it? A great resource is Jake Gordon's blog on simple JavaScript game design. He uses a double buffer front and back canvas game loop.

[0] https://jakesgordon.com/writing/javascript-pong/part1/




Sorry yeah I'm talking very specifically about the stuttering that I first saw when making a square move into the tab bar.

I was doing something inefficient (updating all my favicons many times a second), but I didn't really understand why that would cause stuttering in my foregrounded tab. My thought process was that the favicon stuff was happening in different tabs in different threads, and so it didn't make sense to me that the thread in charge of the foregrounded animation should suffer (unless my entire computer had slowed to a crawl and everything was getting slower - but it hadn't).

And my friend's point was just that i was probably GPU-bound and not CPU-bound (or at least I could be) and so I was not thinking about the original problem correctly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: