Script Preparation code:
Tests:

Historical Performance Data aggregated from 73 community runs

Desktop Results:
Chrome 49 runs
String.fromCharCode
5.0M/s
TextDecoder
3.3M/s

Fastest: String.fromCharCode (1.5x faster)

View exact numbers
  • String.fromCharCode: 4,952,214 ops/sec
  • TextDecoder: 3,328,756 ops/sec
Firefox 24 runs
TextDecoder
6.7M/s
String.fromCharCode
3.4M/s

Fastest: TextDecoder (2.0x faster)

View exact numbers
  • TextDecoder: 6,712,318 ops/sec
  • String.fromCharCode: 3,409,717 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: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:141.0) Gecko/20100101 Firefox/141.0
Firefox 141 on Windows
View result in a separate tab
TextDecoder
9.1M/s
String.fromCharCode
5.5M/s
View exact numbers
Test name Executions per second
TextDecoder 9,080,975 Ops/sec
String.fromCharCode 5,493,561 Ops/sec