Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
if [VS] switch case - v8
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36
Browser:
Chrome 132
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
switch case
457904.4 Ops/sec
if ||
453548.6 Ops/sec
Script Preparation code:
var tipo_el = 'tipo4'; var arrPermision = ['tipo1', 'tipo2', 'tipo3', 'tipo4', 'tipo5'];
Tests:
switch case
switch(tipo_el){ case 'tipo1': case 'tipo2': case 'tipo3': case 'tipo4': case 'tipo5': console.dir('tipo aceitavel'); break; }
if ||
if(tipo_el == 'tipo1' || tipo_el == 'tipo2' || tipo_el == 'tipo3' || tipo_el == 'tipo4' || tipo_el == 'tipo5'){ console.dir('tipo aceitavel'); }