or keys are string literals and all of them differ in length.
Implementation of string search is very efficient due to modern compilers optimize it to a switch by input string length and an integral comparison (rather than a std::memcmp call). In other words, it usually takes O(1) to find the match in the map.
The same story with integral or enum mappings - compiler optimizes them into a switch and it usually takes O(1) to find the match.