Script Preparation code:
Tests:

Historical Performance Data aggregated from 26 community runs

Desktop Results:
Chrome 21 runs
Or bitwise
8.1M/s
Double bitwise not
8.0M/s
Left bitwise shift
7.9M/s
Math.round
6.8M/s

Fastest: Or bitwise (1.2x faster)

View exact numbers
  • Or bitwise: 8,100,670 ops/sec
  • Double bitwise not: 7,978,698 ops/sec
  • Left bitwise shift: 7,937,413 ops/sec
  • Math.round: 6,846,174 ops/sec
Firefox 5 runs
Left bitwise shift
593.8M/s
Math.round
590.6M/s
Double bitwise not
589.3M/s
Or bitwise
527.8M/s

Fastest: Left bitwise shift (1.1x faster)

View exact numbers
  • Left bitwise shift: 593,795,008 ops/sec
  • Math.round: 590,616,896 ops/sec
  • Double bitwise not: 589,339,328 ops/sec
  • Or bitwise: 527,804,832 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
    Or bitwise
    Double bitwise not
    Left bitwise shift
    Math.round

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:140.0) Gecko/20100101 Firefox/140.0
Firefox 140 on Windows
View result in a separate tab
Left bitwise shift
473.2M/s
Or bitwise
470.3M/s
Double bitwise not
469.8M/s
Math.round
469.0M/s
View exact numbers
Test name Executions per second
Left bitwise shift 473,209,088 Ops/sec
Or bitwise 470,269,344 Ops/sec
Double bitwise not 469,772,416 Ops/sec
Math.round 469,049,664 Ops/sec