Run details:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36
Chrome 70
Windows
Desktop
5 years ago
Test name Executions per second
ifTest1 785212608.0 Ops/sec
ifTest2 726270592.0 Ops/sec
ifTest3 740825472.0 Ops/sec
switchTest1 669698368.0 Ops/sec
switchTest2 603759616.0 Ops/sec
switchTest3 632569024.0 Ops/sec
Object keys 683217024.0 Ops/sec
Script Preparation code:
Tests:
  • ifTest1

  • ifTest2

  • ifTest3

  • switchTest1

  • switchTest2

  • switchTest3

  • Object keys