title: Core Text Performance
body: <p>I am seeing some performance issues with Core Text when it is run on the original iPad.</p>
  
  <p>I have created an editable view using Core Text and the <code>UITextInput</code> protocol which is based around OmniGroup's <code>OUIEditableFrame</code>.</p>
  
  <p>When there is a fair amount of text in the view say 180 lines, typing/input lags greatly behind and one tap on a key usually takes 1-2 seconds.</p>
  
  <p>Using instruments with the simulator I was able to narrow down the problem and find out what was taking so much time. Turns out it's because I redraw the frame with every key stroke, what takes up so much time is calling <code>CTFramesetterCreateWithAttributedString</code> and <code>CTFramesetterCreateFrame</code>.</p>
  
  <p>I have to redraw with every key stroke so that the text gets updated, this means calling <code>CTFramesetterCreateWithAttributedString</code> and <code>CTFramesetterCreateFrame</code>.</p>
  
  <p>Has anyone else come upon this problem, and if so, how did they get around it?</p>
  
  <hr>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Did some further investigating and turns out that if the attributed string has no attributes then everything draws so much faster and without any lag. Changing the font, color or paragraphs style all slow it down. Any idea if this could have something to do with it?</p>