Well, one example does a high-speed CPU binary compare, and the other has to convert all characters to lower (or upper???) case, and then do a string compare.
I can't imagine anyone thinking that a raw binary compare that does NOT do any kind of string conversion to ignore case runs faster then code that has to covert the two strings to a common case, has to compare strings in place of raw binary data?
So, not really much of a surprise here, since one has to convert BOTH strings, and do a string compare.
The other example does not do string conversion, does not have to copy the strings (both of them) to a new location (for the case conversion), and then has to do a whole new string compare based on two whole brand-new values in memory, and in a whole new memory location! And all this has to occur not only on a copy of the two values, but the two values BOTH require a conversion to a common case!
So, not only is the case of the two strings require conversion, but that means a copy of the two strings has to occur also! And that means the code has to request and allocate two whole new memory locations.
Given the boatloads of extra memory, and extra processing here, and that of having to copy the two values, make a request for more and a new memory location, and then having to convert the two strings to a common case format? And THEN do a compare?
I get 4.8 vs 279. So, yes, it is about 58 times slower, and the above explains why!
So, not only is the CPU forced to do a string compare (as opposed to a faster binary compare), but a copy of the two values is required, and that means then two requests for two new memory locations has to occur. This will halt the CPU while the OS is now forced to get get and allocate some memory (which now brings the memory controllers into play). Then the two strings must be copied to the new location. Then after the copy of the two strings has occurred, then a case conversion (byte by byte, one character at a time!) for each string has to occur, and then and only then can the compare occur. So, yes, a boatload of extra work has to occur here.