Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bottleneck in CA::Transaction::commit()

When using the Time Profiler on interactions with a UIScrollView (containing many subviews) I often see CA::Transaction::commit() in the heaviest stack trace. What is this method and how can I spend less time in it?

Screenshot

My educated guess is that this is how Core Animation layers are sent to the GPU and that this could be sped up by reducing the dimensions of and/or number of CALayers that must be rendered (i.e. the amount of data that must be sent to the GPU).

like image 408
tboyce12 Avatar asked Jun 05 '14 23:06

tboyce12


1 Answers

Your guess could be correct. Bare in mind that following things are typically also done in the CATransaction::commit()

  • Layouting of CALayers: layoutSublayers, preferredFrameSize, CALayoutManager
  • all CAActions
  • sometimes also the rendering of the various filter-properties of a CALayer
  • probably the layouting of the subviews in your scroll-view
like image 176
mahal tertin Avatar answered Oct 04 '22 01:10

mahal tertin