Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
function typeof benchmark
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:153.0) Gecko/20100101 Firefox/153.0
Browser:
Firefox 153
Operating system:
Windows
Device Platform:
Desktop
Date tested:
one month ago
split typeof
52K/s
typeof
51K/s
View exact numbers
Test name
Executions per second
✓
split typeof
51,959 Ops/sec
typeof
51,360 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function do_not_optimize(v) { $._ = v; } const $ = { _: null, __() { return console.log($._); } }; function A({x,y}) { do_not_optimize( x ? x : do_not_optimize(y)); } function B({x}) { do_not_optimize(typeof x =="string" ? x : do_not_optimize(x)); }
Tests:
split typeof
let c = 1000; while (c--){ A({y: () => "hi"}) A({y:() => "hi"}) A({x:"hi"}) }
typeof
let c = 1000; while (c--){ B({x: () => "hi"}) B({x:() => "hi"}) B({x:"hi"}) }