I am trying to create a fairly simple animation using 6 CALayer objects, each of which is masked along the way. However, I have significant delays when trying to revive them. Here is a video with animation. I can improve performance by setting shouldRasterize to YES , however this results in pixelation of the text, as you can see from this image:

I can fix the pixelation by setting rasterizationScale to the scale of the screen, however this will return the delay bursts that occurred without rasterization!
Here is my code:
@interface splashLayer : CALayer @end @implementation splashLayer { UIColor* color; CALayer* l1, *l2, *l3, *l4, *l5, *l6; CAShapeLayer* m1, *m2, *m3, *m4, *m5, *m6; NSUInteger i; } -(instancetype) init { if (self = [super init]) { color = [lzyColors purpleColor]; i = 0; m1 = [CAShapeLayer layer]; m2 = [CAShapeLayer layer]; m3 = [CAShapeLayer layer]; m4 = [CAShapeLayer layer]; m5 = [CAShapeLayer layer]; m6 = [CAShapeLayer layer]; self.shouldRasterize = YES; self.rasterizationScale = screenScale();
I know the code is very rude, but I just simplified it for debugging.
The colorImage() and textBG() functions just do some Core Graphics rendering to create 6 images for 6 layers. This should not be the source of the problem, because the drawing is simple and the animation is delayed for a second before starting.
I tried setting the rasterizationScale value to the screen scale on the layers displaying the text, but this did not work.
I also tried to improve performance by deleting the two layers under the third layer as soon as he finished the animation, however he did not significantly improve the performance.
-(void) animationDidStop:(CAAnimation *)anim finished:(BOOL)flag { if (flag) { if (i == 2) { [l1 removeFromSuperlayer]; l1 = nil; m1 = nil; [l2 removeFromSuperlayer]; l2 = nil; m2 = nil; l3.mask = nil; m3 = nil; } i++; } }
Any suggestions for improving performance?