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; Ubuntu; Linux x86_64; rv:152.0) Gecko/20100101 Firefox/152.0
Browser:
Firefox 152
Operating system:
Ubuntu
Device Platform:
Desktop
Date tested:
26 days ago
Conditionals
20.4M/s
Object.assign
9.8M/s
View exact numbers
Test name
Executions per second
✓
Conditionals
20,382,438 Ops/sec
Object.assign
9,828,228 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; }