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 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/150.0.0.0 Safari/537.36
Browser:
Chrome 150
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
26 days ago
Conditionals
584.7M/s
Object.assign
50.5M/s
View exact numbers
Test name
Executions per second
✓
Conditionals
584,691,520 Ops/sec
Object.assign
50,543,096 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; }