Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Object.assign vs conditionals
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/149.0.0.0 Safari/537.36
Browser:
Chrome 149
Operating system:
Linux
Device Platform:
Desktop
Date tested:
26 days ago
Conditionals
122.4M/s
Object.assign
17.9M/s
View exact numbers
Test name
Executions per second
✓
Conditionals
122,421,056 Ops/sec
Object.assign
17,910,540 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Tests:
Object.assign
/*When writing async/deferred tests, use `deferred.resolve()` to mark test as done*/ const theObject = {the_first_key: 42, the_second_key: 100}; const newObject = {third: 99, fourth: 202}; Object.assign(theObject, newObject);
Conditionals
/*When writing async/deferred tests, use `deferred.resolve()` to mark test as done*/ const theObject = {the_first_key: 42, the_second_key: 100}; const newObject = {third: 99, fourth: 202}; if (newObject.one !== undefined) { theObject.one = newObject.one; } if (newObject.two !== undefined) { theObject.two = newObject.two; } if (newObject.third !== undefined) { theObject.third = newObject.third; } if (newObject.fourth !== undefined) { theObject.fourth = newObject.fourth; }