enum to string uses a switch if possible (src/phobos/std/conv.d line 844) I think the code that does string to enum is on line 2194, which is a foreach { if {} } loop that never breaks; it always checks all of them.