|
From: | Pádraig Brady |
Subject: | Re: [PATCH] maint: Use logical rather than bitwise operators on bools |
Date: | Thu, 24 Sep 2009 08:20:37 +0100 |
User-agent: | Thunderbird 2.0.0.6 (X11/20071008) |
Pádraig Brady wrote: > I did also check the speed with a test program > (attached) which showed the logical test was a bit faster on my pentium-m. > Note I compiled without optimization like `gcc -march=pentium-m chcon-test.c` > so that the loop was actually run, and I got these (averaged) results: > > $ time ./bitwise > real 0m4.550s > $ time ./logical > real 0m4.173s The above is with bool recurse=false, preserve_root=false in the test prog. I.E. with if (false && true). Switching them gives a surprisingly faster result: $ time ./logical real 0m3.741s
[Prev in Thread] | Current Thread | [Next in Thread] |