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