Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Object.create mutation vs Object.create mutation descriptors vs setPrototypeOf rm
(version: 0)
Comparing performance of:
Object.create mutation vs Object.create mutation descriptors vs setPrototypeOf
Created:
2 years ago
by:
Registered User
Jump to the latest result
Script Preparation code:
for (i = 0; i < 10; i++) {}
Tests:
Object.create mutation
const proto = { m1() { return 4324 }, m2() { return "park"} }; const obj = Object.create(proto) obj.age = 65 obj.name = "john"
Object.create mutation descriptors
const proto = { m1() { return 4324 }, m2() { return "park"} }; const obj = Object.create(proto, Object.getOwnPropertyDescriptors({age: 65, name: "john"}));
setPrototypeOf
const proto = { m1() { return 4324 }, m2() { return "park"} }; const obj = {age: 65, name: "john"} Object.setPrototypeOf(obj, proto);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (3)
Previous results
Fork
Test case name
Result
Object.create mutation
Object.create mutation descriptors
setPrototypeOf
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:
Object.assign vs mutation assign
Object.assign mutation vs spread
Object.assign() vs Reflect.set()
Object.setPrototypeOf vs Object literal
Object.assign vs mutation
Comments
Confirm delete:
Do you really want to delete benchmark?