Messages in this thread | | | Subject | Re: Non-urgent issue with fs/isofs/util.c | Date | Mon, 21 Sep 1998 15:52:15 -0400 | From | Horst von Brand <> |
| |
"Helge Hafting" <helge.hafting@daldata.no> said:
[...]
> The equivalent code > if (!((year+2) & 3) && month > 2 && year != 130) is probably > faster. The somewhat expensive mod operator is > replaced by a bitwise "and", that is faster on most platforms.
... and your compiler knows that, and should replace the original code by this one if warranted. Take a look at the assembly output for both alternatives before proposing optimizations. -- Dr. Horst H. von Brand mailto:vonbrand@inf.utfsm.cl Departamento de Informatica Fono: +56 32 654431 Universidad Tecnica Federico Santa Maria +56 32 654239 Casilla 110-V, Valparaiso, Chile Fax: +56 32 797513
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |