Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Encode byte string test (string concatenation vs. map join)
Encode byte string
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36
Browser:
Chrome 134
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one year ago
Benchmark engine:
Benchmark.js
String concatenation (from Uint8Array)
621K/s
String concatenation (from Uint8Array converted to Array)
491K/s
Array map join
476K/s
View exact numbers
Test name
Executions per second
✓
String concatenation (from Uint8Array)
620,620 Ops/sec
String concatenation (from Uint8Array converted to Array)
491,062 Ops/sec
Array map join
475,546 Ops/sec
Script Preparation code:
var text = '鉴于对人类家庭所有成员的固有尊严及其平等的和不移的权利的承认,乃是世界自由、正义与和平的基础'; var uint8Array = new TextEncoder().encode(text);
Tests:
String concatenation (from Uint8Array)
let byteStr = ''; uint8Array.forEach(i => { byteStr += String.fromCharCode(i); });
Array map join
let byteStr = new Array(uint8Array).map(i => String.fromCharCode(i)).join('');
String concatenation (from Uint8Array converted to Array)
let byteStr = ''; new Array(uint8Array).forEach(i => { byteStr += String.fromCharCode(i); });