JavaScript Conditional Branching Test

The purpose of this page is to determine the performance issues related to conditional branching in JavaScript. Conditional branching can be accomplished using if statements, switch statements, or array lookup. The tests on this page run through a series of conditional branches to determine which is fastest in each situation. The tests are run multiple times and the average is reported.

The tests may take several minutes to fully execute but should not crash the browser.

Back to my site.

Run each test times

Results