Live data from Hacker News

Spin.js, a pure JS spinner

fgnass.github.com

11–20 of 70 posts

Re: Spin.js, a pure JS spinner

#13

I hate to be that guy but this takes up 45% cpu under firefox for a simple spin animation.

1% on chrome

CPU time measurements, especially percentages, get very fuzzy when the CPU isn't loaded.

I'm on Chromium 12 on a Fedora 15 box. Top reports ~25% (on a dual core Arrandale, so that's about 1/8th the available CPU time), but checking the clocks more carefully shows that they're spending half their time in sleep states and never moving from the 1.2GHz base speed (this model turbos at 2.9GHz). So my envelope tells me this is about 4-5% usage vs. a fully loaded system.

Re: Spin.js, a pure JS spinner

#15

I hate to be that guy but this takes up 45% cpu under firefox for a simple spin animation.

My gut feeling is that if you rendered the different stages of the animation into multiple images using canvas and just toggled their visibility, you could get better performance.

Re: Spin.js, a pure JS spinner

#18
post #16
post #4

What's the battery drain like?

It's not like animating a gif doesn't use up CPU cycles.

I accidentally upvoted you (trying to view your profile, I dont have downvote privileges). The CPU use of just about any GIF spinner is trivial compared to this, even in the browser this runs best in. Sure its a solid enough concept, but not something that'd you actually use in practice yet.
Post reply on HN