Hey everyone. You know how simple operations take different speeds? For example, addition takes less time than division. Reading takes less time than assigning. (I think) (You get the point)
Is there some sort of table that can tell me the speeds? Or a way I can determine it? I'm trying to make a processor-intensive area faster, and I came on this problem:
Is it faster like this...
or...Code:int Operation( int A, int B ) { int C = A + B; return C * C; }
It's a question of which is faster, two additions or making another integer.Code:int Operation( int A, int B ) { return ( A + B ) * ( A + B ); }
So is there some sort of table somewhere? Or a way I can find out the speeds of these operations?