Tests:

Historical Performance Data aggregated from 13 community runs

Desktop Results:
Chrome 13 runs
short Number class call
11.9M/s
long Number class call
11.7M/s
short parseInt()
11.5M/s
short JSON.parse
7.2M/s
long parseInt()
5.7M/s
long eval()
5.7M/s
short eval()
5.6M/s
long JSON.parse
3.6M/s

Fastest: short Number class call (3.3x faster)

View exact numbers
  • short Number class call: 11,856,379 ops/sec
  • long Number class call: 11,726,817 ops/sec
  • short parseInt(): 11,536,102 ops/sec
  • short JSON.parse: 7,175,201 ops/sec
  • long parseInt(): 5,732,454 ops/sec
  • long eval(): 5,722,224 ops/sec
  • short eval(): 5,637,142 ops/sec
  • long JSON.parse: 3,607,869 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
    long eval()
    long parseInt()
    short eval()
    short parseInt()
    short Number class call
    long Number class call
    short JSON.parse
    long JSON.parse

    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) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36 Edg/140.0.0.0
Chrome 140 on Windows
View result in a separate tab
short parseInt()
170.1M/s
long Number class call
163.2M/s
short Number class call
153.4M/s
short JSON.parse
40.1M/s
short eval()
25.2M/s
long eval()
24.7M/s
long parseInt()
13.4M/s
long JSON.parse
8.1M/s
View exact numbers
Test name Executions per second
short parseInt() 170,074,480 Ops/sec
long Number class call 163,232,432 Ops/sec
short Number class call 153,391,696 Ops/sec
short JSON.parse 40,129,780 Ops/sec
short eval() 25,178,994 Ops/sec
long eval() 24,657,034 Ops/sec
long parseInt() 13,441,430 Ops/sec
long JSON.parse 8,119,364 Ops/sec