> 5) Some statements he did like "it's memory optimized instead of speed > optimized" are ... wrong ? > Well which of these two lines is faster: > (y << wDec | x) > (y*w + x) > He says the second is faster, and I don't see why, because I think it's > either the same or the first is faster. Can someone explain me why ? >
The first one should be faster : less micro-ops in the resulting assembly, I would expect. However, it might very well be that the compiler is better at optimizing the second line... This *might* result in slightly better cache use. But as this is a kind of optimization that is super compiler- and optimization-level- dependant, you might as well do nothing :) > Computer never do it the way you expect it.... Especially not when the compiler tries to be clever. Sometimes, the naive code is better than the optimized, just because the compiler is so much better at optimizing naive code... CU -- CFD PS my message said essentially "beware compilers !" _______________________________________________ glob2-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/glob2-devel
