Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Array from set
(version: 1)
Comparing performance of:
Array from Set vs Array from spread
Created:
5 months ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<!--your preparation HTML code goes here-->
Tests:
Array from Set
const foo = [{ name: 'Alice', age: 25, contact: { email: 'alice@example.com', phone: '123-456-7890', }, preferences: { language: 'English', timezone: 'UTC', }, }, { name: 'Peter', age: 25, contact: { email: 'peter@example.com', phone: '123-456-7890', }, preferences: { language: 'English', timezone: 'UTC', }, }]; Array.from(new Set(foo.map(p => name)))
Array from spread
const foo = [{ name: 'Alice', age: 25, contact: { email: 'alice@example.com', phone: '123-456-7890', }, preferences: { language: 'English', timezone: 'UTC', }, }, { name: 'Peter', age: 25, contact: { email: 'peter@example.com', phone: '123-456-7890', }, preferences: { language: 'English', timezone: 'UTC', }, }]; [...new Set(foo.map(p => name))]
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
Array from Set
Array from spread
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
5 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Browser/OS:
Chrome 142 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
Array from Set
7661685.0 Ops/sec
Array from spread
7773940.5 Ops/sec
Related benchmarks:
Lodash cloneDeep vs JSON Clone 6
letsfindout
Test Test 3123213
affafaf
Different ways of creating objects 2
json and
taetas
Nested object
JavaScript spread operator vs Object.assign performance (bigger objects)
Comments
Confirm delete:
Do you really want to delete benchmark?