iphone - Efficiency of CALayer and how many is the limit -
in iphone app, need show large number (max 150) of small dots of 10x10 pixels move around screen individually. don't need move smoothly in way, need updated every second or so. have implemented single calayer redraw every second.
but understand calayers efficient because mapped gpu hardware. wondered if more efficient (in terms of battery usage) create separate calayer each dot , move setting position properties.
so wonder whether have experience that. cpu have less do, gpu more. how many calayers can still handled gpu hardware?
if make them separate calayers, animate them, better. lot more energy intensive?
what makes worse in case, use catiledlayer them, maximum of 4 tiles exposed. means need redraw them 4 times each update.
there. have met similar problem did. in case, drawing 80 or bar risers in bar chart. previously, use uiview (with drawrect implemented) each riser, , later decided use calayer (without implementing drawlayerincontext) each of them animation. bar number 80, found 1. uiview method consumes more memory(as request cgcontext in drawrect). 2. uiview method has better animation responsiveness. in case, uive fps 60, calayer 34.
later, tried case less bar number (40, 30, etc), gpu less stressed, , can satisfied fps number calayer animation.
what want mention here when switch "one layer per dot", need check out if animaiton smooth before.
Comments
Post a Comment