Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
string concat bla
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36
Browser:
Chrome 123
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
string + id concact
9588.1 Ops/sec
first string then id
32021.3 Ops/sec
Script Preparation code:
var names = ["result_", "report_", "session", "result_", "report_", "session","result_", "report_", "session","result_", "report_", "session","result_", "report_", "session","result_", "report_", "session","result_", "report_", "session"]; var map = new Map(); for (var i = 0; i < 50; i++) { var key = names[i] + (i + 1); var value = Math.floor(Math.random() * 1001); // Generate random value between 0 and 1000 map.set(key, value); } var map2 = {}; map2["result_"] = new Set([0,1,2,3,4,5,6,7,8,9,10,11,12,13]); map2["report_"] = new Set([0,1,2,3,4,5,6,7,8,9,10,11,12,13]); map2["session"] = new Set([0,1,2,3,4,5,6,7,8,9,10,11,12,13]);
Tests:
string + id concact
for (var i = 0; i < 333; i++) { const key = `$result_${i}`; const result = map[key]; } for (var i = 0; i < 333; i++) { const key = `$report_${i}`; const result = map[key]; } for (var i = 0; i < 333; i++) { const key = `$session_${i}`; const result = map[key]; }
first string then id
for (var i = 0; i < 333; i++) { const result1 = map["result_"]; if (result1) { const result = result1.get(i); } } for (var i = 0; i < 333; i++) { const result1 = map["report_"]; if (result1) { const result = result1.get(i); } } for (var i = 0; i < 333; i++) { const result1 = map["session_"]; if (result1) { const result = result1.get(i); } }