I am trying to optimize an application and while I was working on that I stumbled upon a question that I can't really find an answer for.
I was wondering whether there was a performance penalty for comparing Signed variables against Unsigned variables, such as displayed below in this post.
I have a lot of memory to play with so increased memory usage is alright for me, so if there is a performance hit (even a nano second) then I'd rather exchange them with a bigger signed indentifier (I require the negative values).
hmm, this also creates the question as whether Signed or Unsigned variables are faster if used exclusively...
For example:
Expand|Select|Wrap|Line Numbers
- unsigned char variable_a = 5;
- short variable_b = 5;
- if(variable_a > variable_b) // < >= <= == whatever
- {
- //bla
- }