Should I use big switch statements in JavaScript without performance problems?
问题 I've google'd a bit but I still feel to be lost. I am writing a CPU emulator in JavaScript (namely Z80 in me case, currently). There is a huge switch statement in its heart. Though I can run some benchmarks of course, I can't be sure about future JavaScript engines of different browsers (ok, nobody can be, I know, but somebody should have greater knowledge of javascript engines of different browsers here than me ...). Is it faster to use other constructs than switch statement? Like an array