Script Preparation code:
Tests:

Historical Performance Data aggregated from 13 community runs

Desktop Results:
Chrome 13 runs
charAt()
5.8M/s
charCodeAt()
5.8M/s
character index
5.8M/s
slice()
5.8M/s
View exact numbers
  • charAt(): 5,838,784 ops/sec
  • charCodeAt(): 5,837,962 ops/sec
  • character index: 5,820,174 ops/sec
  • slice(): 5,811,290 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
    character index
    charAt()
    slice()
    charCodeAt()

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 15 days ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36 Edg/150.0.0.0
Chrome 150 on Windows
View result in a separate tab
character index
239.6M/s
charAt()
237.8M/s
charCodeAt()
237.8M/s
slice()
237.3M/s
View exact numbers
Test name Executions per second
character index 239,559,152 Ops/sec
charAt() 237,822,720 Ops/sec
charCodeAt() 237,781,664 Ops/sec
slice() 237,264,240 Ops/sec