Re: Using unsigned int for loop counters - better performance for Architectures - urban hacker legend?

From: David Newall
Date: Sat Jul 31 2010 - 05:39:12 EST


I don't know about unsigned int; but looping down to zero should be faster on many architectures, as they automatically test for zero (or negative) on decrement. Counting up requires an additional test.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/