Yes
Using JSPerf, I profiled my example here: http://jsperf.com/inline-switch-vs-switch-function
I tested the inline switch statement with 4 simple arithmetic operators against the identical switch statement extracted into its own function over an array with 100k elements. I also tested it using a randomized switch operator, a best case operator (first switch option) and a worst case operator (last switch option).
The integrated switch operator exceeded the function across the board, outperforming the function by 150 op / s in the worst case, ~ 600 op / s in the best case.
In this situation, the inline switch statement will be noticeably faster.
source share