Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/109.0
Firefox 109
Windows
Desktop
one year ago
Test name Executions per second
floor 93021032.0 Ops/sec
~~ 101585400.0 Ops/sec
>> 0 95954520.0 Ops/sec
| 0 104342760.0 Ops/sec
<< 0 91011104.0 Ops/sec
& 0xFFFFFFFFFFFF 86349832.0 Ops/sec
^ 0x000000000000 107056488.0 Ops/sec
Math.trunc() 92704448.0 Ops/sec
x - (x % 1) 355190816.0 Ops/sec
parseInt() 101909072.0 Ops/sec
Script Preparation code:
Tests:
  • floor

  • ~~

  • >> 0

  • | 0

  • << 0

  • & 0xFFFFFFFFFFFF

  • ^ 0x000000000000

  • Math.trunc()

  • x - (x % 1)

  • parseInt()


;