Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
TextDecoder vs String.fromCharCode 2023
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36
Browser:
Chrome 121
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
TextDecoder
1825748.8 Ops/sec
String.fromCharCode
4663309.0 Ops/sec
Script Preparation code:
var arr = new Uint8Array([84, 104, 105, 115, 32, 105, 115, 32, 97, 32, 85, 105, 110, 116, 56, 65, 114, 114, 97, 121, 32, 99, 111, 110, 118, 101, 114, 116, 101, 100, 32, 116, 111, 32, 97, 32, 115, 116, 114, 105, 110, 103 ]);
Tests:
TextDecoder
new TextDecoder().decode(arr)
String.fromCharCode
String.fromCharCode.apply(null, arr)