> On Jan 10, 2018, at 3:48 AM, Devarshi Kulshreshtha 
> <[email protected]> wrote:
> 
> I had a discussion with my colleagues regarding use
> of dequeueReusableCellWithIdentifier, few of them are under assumption that
> if there are less number of cells it is better to directly alloc init a
> UITableViewCell in place of using dequeueReusableCellWithIdentifier. They
> are saying that since at a time almost all the cells will be displayed
> there is no need to use dequeueReusableCellWithIdentifier because it
> degrades performance in comparison to alloc init, in such scenarios. My
> understanding is that there is no any performance cost as such and behind
> the scenes dequeueReusableCellWithIdentifier is doing the same thing
> (allocating and initializing) if a cell cannot be reused.
> 
> Is there any way I can compare the performance of using
> dequeueReusableCellWithIdentifier versus using directly alloc init and
> share with them to come to a conclusion? Please suggest.

The overhead of calling dequeueReusableCellWithIdentifier: should be extremely 
minimal. The static/short table case is actually more likely to be a case where 
breaking the standard pattern is only going to lead to future maintenance 
headaches vs achieving any significant performance improvements.

If you want to measure the difference, you would probably just call alloc/init 
vs dequeue in a tight loop and measure the total time taken. If you find a case 
that seems problematic, it would be worth a bug report.

> 
> -- 
> Thanks,
> 
> Devarshi
> _______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/cocoa-dev/david.duncan%40apple.com
> 
> This email sent to [email protected]

--
David Duncan

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to