title: Large UIBezierPath, slow rendering
body: <p>For an app I am creating, I am using a <code>UIBezierPath</code> to store a path. The problem is that this path continually increases in length, and at a point, the app lags and becomes jerky. Because the path is continually increasing in length, I am constantly redrawing the view 100 times a second (if there is a better way to do this, please let me know). At a certain point, the app just becomes extremely jerky. I think it is because it takes too long to stroke the path.</p>
  
  <p>You can see in my <code>drawRect</code> method that the graphics are translated. Very little of the path is on the screen, so is there a way to only stroke the part of the path that is visible? That is what I thought I was doing with the <code>CGContextClip</code> method, but it had no noticeable improvement.</p>
  
  <pre><code>- (void)drawRect:(CGRect)rect {
      CGContextRef myContext = UIGraphicsGetCurrentContext();
      CGContextTranslateCTM(myContext, 0, yTranslation);
      [[UIColor whiteColor] setStroke];
      [bPath addLineToPoint:currentPoint];
      [bPath setLineWidth:lineWidth];
      CGContextClip(myContext);
      [bPath stroke];
  }
  </code></pre>
  
  <p>Thank you.</p>