Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36
Chrome 110
Linux
Desktop
one year ago
Test name Executions per second
floor 1244674.0 Ops/sec
~~ 2268352.0 Ops/sec
>> 0 2277659.2 Ops/sec
| 0 2274971.0 Ops/sec
<< 0 2267598.8 Ops/sec
& 0xFFFFFFFFFFFF 2270318.5 Ops/sec
^ 0x000000000000 2275110.2 Ops/sec
Math.trunc() 1253003.4 Ops/sec
x - (x % 1) 1521929.2 Ops/sec
parseInt() 1256551.8 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;