Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
No string building — faster code! Or nor?..
(version: 0)
Comparing performance of:
build strings and compare them vs compare declarative objects
Created:
5 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
function translate(arg1, arg2) { return ` some text ${arg1} other text ${arg2}`; } const template = [' some text ', ' other text ']; function getTranslatable(arg1, arg2) { return { template: template, args: [arg1, arg2], }; } function isEqual(t1, t2) { if (t1.template !== t2.template) { return false; } return t1.args.every((arg, index) => arg === t2.args[index]); } results1 = []; results2 = [];
Tests:
build strings and compare them
const s1 = translate(1, 'foo'); const s2 = translate(1, 'foo'); results1.push(s1 !== s2);
compare declarative objects
const t1 = getTranslatable(1, 'foo'); const t2 = getTranslatable(1, 'foo'); results2.push(isEqual(t1, t2));
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
build strings and compare them
compare declarative objects
Fastest:
N/A
Slowest:
N/A
Latest run results:
No previous run results
This benchmark does not have any results yet. Be the first one
to run it!
Related benchmarks:
Spreading arguments
spread vs slice vs splice vs concat
const vs let vs var2
Lodash.get vs Lodash.property vs native test
const vs let vs var comparison
Comments
Confirm delete:
Do you really want to delete benchmark?