02.05.2016, 15:27
Quote:
Boohoo, 100 nanoseconds difference. Readability should always take precedence over such extremely negligible improvements.
|
Quote:
Completely agree. This whole optimization thing is major overkill. I think it originated from Y_Less in that huge code optimazitions thread that was later proven redundant when it was benchmarked.
|
Which one is ugly?
Код:
new Float:pos[3]; GetPlayerPos(0, pos[0], pos[1], pos[2]);
Код:
new Float:X, Float:Y, Float:Z; GetPlayerPos(0, X, Y, Z);
Код:
new tmp1; new tmp2; new tmp3; new tmp4; new tmp5;
Код:
new tmp1, tmp2, tmp3, tmp4, tmp5;
Код:
tmp1 = 17; tmp2 = 17; tmp3 = 17; tmp4 = 17; tmp5 = 17; tmp1 = tmp2 = tmp3 = tmp4 = tmp5 = 17;
Код:
if(tmp1 == 1) if(tmp2 == 1) if(tmp3 == 1) if(tmp4 == 1) if(tmp5 == 1) {} if(tmp1 == 1 && tmp2 == 1 && tmp3 == 1 && tmp4 == 1 && tmp5 == 1) {}
Maybe someday in future, I will make a neat topic which will list optimizations that really make a "big" improvement which are actually based on "smart ideas" rather than coding techniques.