Script Preparation code:
Tests:

Historical Performance Data aggregated from 10 community runs

Desktop Results:
Chrome 10 runs
FAST CEIL
18.6M/s
~~test
18.5M/s
Math.floor(test)
7.0M/s
Math.ceil(test)
7.0M/s
Math.floor(test) + 1 (CEIL)
7.0M/s

Fastest: FAST CEIL (2.7x faster)

View exact numbers
  • FAST CEIL: 18,598,986 ops/sec
  • ~~test: 18,483,350 ops/sec
  • Math.floor(test): 7,049,193 ops/sec
  • Math.ceil(test): 7,032,581 ops/sec
  • Math.floor(test) + 1 (CEIL): 6,993,165 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.ceil(test)
    ~~test
    Math.floor(test)
    Math.floor(test) + 1 (CEIL)
    FAST CEIL

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 5 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/144.0.0.0 Safari/537.36 Edg/144.0.0.0
Chrome 144 on Windows
View result in a separate tab
~~test
136.5M/s
Math.ceil(test)
130.1M/s
FAST CEIL
127.7M/s
Math.floor(test) + 1 (CEIL)
126.5M/s
Math.floor(test)
108.4M/s
View exact numbers
Test name Executions per second
~~test 136,515,248 Ops/sec
Math.ceil(test) 130,052,784 Ops/sec
FAST CEIL 127,713,448 Ops/sec
Math.floor(test) + 1 (CEIL) 126,454,824 Ops/sec
Math.floor(test) 108,444,304 Ops/sec