Math.floor vs parseInt vs Bitwise (v136)

Revision 136 of this benchmark created on


Description

Flooring, no bias (function overhead wasn't calculated)

Setup

var result = 934815067337773 / 37;
    
    function bitwiseV(num){
      return num | 0;
    }
    
    function bitwise(num){
      return num >> 0;
    }
    
    function bitwisezf(num){
      return num >>> 0;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Math.floor
Math.floor(result);
ready
parseInt
parseInt(result, 10);
ready
Bitwise |
bitwiseV(result);
ready
Bitwise
bitwise(result);
ready
Bitwise zf
bitwisezf(result);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.