optimize rendering code
Merge pull request #9692 from dabingnn/v3_perf

optimize rendering code