Script Preparation code:
Tests:

Historical Performance Data aggregated from 111 community runs

Desktop Results:
Chrome 72 runs
String.fromCharCode
3.5M/s
TextDecoder
3.1M/s

Fastest: String.fromCharCode (1.1x faster)

View exact numbers
  • String.fromCharCode: 3,509,007 ops/sec
  • TextDecoder: 3,113,405 ops/sec
Firefox 26 runs
TextDecoder
6.4M/s
String.fromCharCode
3.4M/s

Fastest: TextDecoder (1.9x faster)

View exact numbers
  • TextDecoder: 6,389,780 ops/sec
  • String.fromCharCode: 3,408,678 ops/sec
Mobile Results:
Chrome 8 runs
String.fromCharCode
3.0M/s
TextDecoder
2.4M/s

Fastest: String.fromCharCode (1.3x faster)

View exact numbers
  • String.fromCharCode: 3,033,856 ops/sec
  • TextDecoder: 2,397,138 ops/sec
Safari 5 runs
TextDecoder
3.6M/s
String.fromCharCode
2.8M/s

Fastest: TextDecoder (1.3x faster)

View exact numbers
  • TextDecoder: 3,605,730 ops/sec
  • String.fromCharCode: 2,794,995 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
    String.fromCharCode
    TextDecoder

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 3 months ago)
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/147.0.0.0 Safari/537.36
Chrome 147 on Linux
View result in a separate tab
String.fromCharCode
8.1M/s
TextDecoder
7.1M/s
View exact numbers
Test name Executions per second
String.fromCharCode 8,118,327 Ops/sec
TextDecoder 7,104,510 Ops/sec