Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Chrome 117
Windows
Desktop
one year ago
Test name Executions per second
floor 1333821.9 Ops/sec
~~ 3403810.2 Ops/sec
>> 0 3285433.0 Ops/sec
| 0 3025359.8 Ops/sec
<< 0 2687250.8 Ops/sec
& 0xFFFFFFFFFFFF 3272577.2 Ops/sec
^ 0x000000000000 3237283.8 Ops/sec
Math.trunc() 1579395.5 Ops/sec
x - (x % 1) 1764377.5 Ops/sec
parseInt() 1841981.5 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;