Tests:

Historical Performance Data aggregated from 15 community runs

Mobile Results:
Chrome 15 runs
Modulo
51.8M/s
Right shift
51.7M/s
double negation
51.6M/s
bitwise XOR
51.3M/s
bitwise OR
49.8M/s
Unsigned right shift
49.3M/s
Math.trunc
46.0M/s
Math.floor
44.7M/s
Math.round
44.5M/s
parseInt
37.2M/s

Fastest: Modulo (1.4x faster)

View exact numbers
  • Modulo: 51,788,848 ops/sec
  • Right shift: 51,708,760 ops/sec
  • double negation: 51,644,856 ops/sec
  • bitwise XOR: 51,264,748 ops/sec
  • bitwise OR: 49,780,636 ops/sec
  • Unsigned right shift: 49,288,260 ops/sec
  • Math.trunc: 45,974,376 ops/sec
  • Math.floor: 44,678,556 ops/sec
  • Math.round: 44,513,300 ops/sec
  • parseInt: 37,214,428 ops/sec

Results show median performance across all community submissions. Run this benchmark yourself to verify on your device.

Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results
  • Test case name Result
    Math.floor
    Math.round
    Math.trunc
    parseInt
    double negation
    bitwise XOR
    bitwise OR
    Right shift
    Unsigned right shift
    Modulo

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Chrome 138 on Linux
View result in a separate tab
Right shift
129.1M/s
Math.trunc
122.8M/s
bitwise XOR
117.4M/s
bitwise OR
114.6M/s
Unsigned right shift
110.1M/s
Math.round
108.1M/s
Math.floor
106.3M/s
Modulo
102.6M/s
double negation
101.0M/s
parseInt
72.6M/s
View exact numbers
Test name Executions per second
Right shift 129,094,416 Ops/sec
Math.trunc 122,790,152 Ops/sec
bitwise XOR 117,431,152 Ops/sec
bitwise OR 114,605,184 Ops/sec
Unsigned right shift 110,081,464 Ops/sec
Math.round 108,058,320 Ops/sec
Math.floor 106,344,352 Ops/sec
Modulo 102,635,832 Ops/sec
double negation 100,978,560 Ops/sec
parseInt 72,551,952 Ops/sec