Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
new class from fn vs function returning obj from fn 2
Measure the performance of instanceOf operator vs comparing a basic string type.
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Browser:
Chrome 117
Operating system:
Linux
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
new class
14204040.0 Ops/sec
new fn
9910564.0 Ops/sec
HTML Preparation code:
<script> class TestClass { constructor() { this.a = 2; this.t = 'mesh'; } } function TestFn(){ return { a:2, t:'mesh' }; } </script>
Tests:
new class
var obj = new TestClass()
new fn
var obj = TestFn()