Script Preparation code:
Tests:

Historical Performance Data aggregated from 6 community runs

Desktop Results:
Chrome 6 runs
base64ArrayBuffer function
2.7M/s
String.fromCharCode & btoa
1.8M/s

Fastest: base64ArrayBuffer function (1.5x faster)

View exact numbers
  • base64ArrayBuffer function: 2,713,919 ops/sec
  • String.fromCharCode & btoa: 1,760,556 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 & btoa
    base64ArrayBuffer function

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 months ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/148.0.0.0 Safari/537.36
Chrome 148 on Windows
View result in a separate tab
base64ArrayBuffer function
8.5M/s
String.fromCharCode & btoa
4.6M/s
View exact numbers
Test name Executions per second
base64ArrayBuffer function 8,531,959 Ops/sec
String.fromCharCode & btoa 4,646,674 Ops/sec