Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Reflect.construct vs new and setPrototypeOf
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Safari/605.1.15
Browser:
Safari 18
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
5 months ago
Test name
Executions per second
new and setPrototypeOf
59456628.0 Ops/sec
Reflect.construct
43468056.0 Ops/sec
Script Preparation code:
function A() {} A.prototype.x = 10; function B() { const a = new A() Object.setPrototypeOf(a, B.prototype) } B.prototype.y = 11; function C() { const a = Reflect.construct(A, [], C) } C.prototype.z = 12;
Tests:
new and setPrototypeOf
new B()
Reflect.construct
new C()