Re: Fast path efficiency (Re: [rfc][patch] dynamic data structure switching)

From: Andi Kleen
Date: Thu Sep 06 2007 - 07:35:20 EST


Oleg Verych <olecom@xxxxxxxxxxxxxx> writes:
>
> What is more efficient in general sense,
> as opposed to s,3,2,1,0 Optimized?

In general it shouldn't matter at all on any reasonably
modern CPU (let's say less than 10 years old) unless you do
it tens of thousands of times in a loop. Also gcc has reasonable
default heuristics for this kind of stuff anyways
(e.g. return NULL or return negative value is predicted
unlikely by default)

Cache misses are far more important to care about because
they cost hundreds of cycles.

-Andi
-
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/