CrazyTim/spin-wheel

Need smooth animation of canvas

Opened this issue · 1 comments

Imagine 2000 items in the wheel. Although items are tiny, you can't get the wheel to spin smoothly. It looks lagging, as if it jumps several items ahead of the pointer.

Hi @macdelacruz,

I'm not sure 2000 or even 200 items is a good use case for a wheel? A roulette wheel has about 40. Why so many?

Having said that, the wheel does make a lot of canvas calls on each frame, which can probably be optimised. I noticed a drop in FPS at around 100 items. This was on an intel 2.4GHz with integrated graphics. It would be great if the number of items didn't affect performance, and this might be worth looking into for lower-end devices.

Note: If I set the labels to empty string (not rendered), then there was no drop in FPS on my machine up to 2000 items, so it looks like the text rendering takes a huge toll.

Note: The items didn't render at all if there was over 25k items. Which is interesting I guess 😄