I understand that we don't need to cast explicitly into another data type by using compound assignment operators in some cases. I want to know which way can provide better performance? or their performance levels are same?
regarding to line 4 and 5, which line provides better performance?
Probably the compound assignment, but it REALLY doesn't matter. You need to use the clearest code, which in this case is the compound assignment. The difference in performance is going to mean absolutely nothing compared to other operations that your application has to perform, such as displaying data, networking, accessing databases and files, etc.