# Multiplication (int) vs Bit-Shifting (left) (v2)

## Description

A friend of mine was pretty excited to learn that there are possible speed increases associated with shifting bits over the multiplication operator, or by using multiplication over the division operator. However, I wonder if a good compiler or interpreter wouldn't make these optimization choices for you! Let's find out with JS!

## Test runner

Testing in
TestOps/sec
Multiplication (int)
``````(function(){return 10 * 2})();
(function(){return 10 * 4})();
(function(){return 10 * 8})();``````
Bit-Shifting (left)
``````(function(){return 10 << 1})();
(function(){return 10 << 2})();
(function(){return 10 << 3})();``````
Division Operator
``````(function(){return 10 / 2})();
(function(){return 10 / 4})();
(function(){return 10 / 8})();``````
Division through Multiplying by a Float
``````(function(){return 10 * 0.5})();
(function(){return 10 * 0.25})();
(function(){return 10 * 0.125})();``````
``````(function(){return 10 >> 1})();