Was talking about shifting binary number is longer then the same "base 10" arithmetic operation...
Which is no sense in processor calculation.
Try the same comparison in ASM, C++, PHP etc. and look the result^^
But in this case I think it's because x = 0b0011_1100<<2
affect the decimal number of the binary one to x
variable so the number of edge clock needed is greater... IMO
Edit: And for loop isn't for me Result-for-each-variables.txt
here is my results of the test that ThomThom put above to prove that for
loop is better then each
one and that declaring variable before is faster too but it's still not true for my equipment...
(Ruby 1.9.2-p180 / Windows 7 64 bit / Intel Core i3 M 350 2.27GHz)
So I think that these optimizations depend of many variables....(versions of Ruby/Sketchup) Even if some will still be true in the future...