For those that don't get it, the problem is not that the switch statement is slow. And it's also not a big problem, modern bloated software has worse problems.
HOWEVER giant if/switch statements like this show that you have very, very skill and can't even use lists/arrays. This is common to see with total beginners, often kids.
For a problem like mapping numbers to strings, instead of having a big if/switch statement you should use a list, array or whatever such a structure is called in your language.
// This is bad:
if (n === 0 ) {
string = "zero"
} else if ( n === 1) {
string = "one"
}
...
//This is what you should do:
const numberStrings = ["zero", "one", ...]
const string = numberStrings[n]
This is much easier to work with, and the code is much shorter. Easier to let other people work on as well. And it's ready to take in the list of string from another source as well, such as if you refactor or add translations to another language.