Tests:

Historical Performance Data aggregated from 43 community runs

Desktop Results:
Chrome 43 runs
round
8.3M/s
floor
8.2M/s
trunc
8.2M/s
parseFloat to int
2.8M/s

Fastest: round (3.0x faster)

View exact numbers
  • round: 8,253,639 ops/sec
  • floor: 8,166,661 ops/sec
  • trunc: 8,155,592 ops/sec
  • parseFloat to int: 2,769,483 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
    trunc
    round
    floor
    parseFloat to int

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 9 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Chrome 137 on Windows
View result in a separate tab
round
181.2M/s
floor
179.9M/s
trunc
165.5M/s
parseFloat to int
6.8M/s
View exact numbers
Test name Executions per second
round 181,226,768 Ops/sec
floor 179,902,656 Ops/sec
trunc 165,500,736 Ops/sec
parseFloat to int 6,831,086 Ops/sec