Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
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:
10 months ago
Benchmark engine:
Benchmark.js
new and setPrototypeOf
59.5M/s
Reflect.construct
43.5M/s
View exact numbers
Test name
Executions per second
✓
new and setPrototypeOf
59,456,628 Ops/sec
Reflect.construct
43,468,056 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()