Quote:
Now have a look here. Iterating 10000000 times this is the order of fastest method first. First takes between 4.6sec and 4.8sec. The second one could be equivalent. Maybe it was a little subjectiv view here but it is not faster it seems to result more often in results like 4.9sec.
The third is from 4.9sec to 5sec and the last about 5.2sec. But using void() is different from using our own function :o)
void( a[int(int(j) % int(360))] );
void( a[int(j % 360)] );
void( a[(j % 360)|0] );
void( a[j % 360] );
The results are
13.5sec for void0( a[int(j % 360)] ) and - surprise, surprise - 13.6sec for void0( a[j % 360] ).
So this reveals for me that it should be done for hardcore optimizations but I think everyday code should use array[i] instead of casting the type correctly because of easy readability. There is no huge speed increase here.
Read