immprove rendering peformance in loop