Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
new class vs function returning obj
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/123.0.0.0 Safari/537.36
Browser:
Chrome 123
Operating system:
Linux
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
new class
23712358.0 Ops/sec
new fn
20563078.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();