In particular, case conversion is often used to implement
case-insensitive
comparision, an operation that is often present on the program's fast paths
as a part of data container lookups and content manipulation.
So it is usually desirable to make case conversions as fast as possible.
In this post we are going to look at one of the options - very fast
case conversion using
compressed lookup tables and also at some
options for compressing these even further.
If in rush, you can jump straight to the Conclusion.
Lookup tables
The simplest way to do the case conversion is with a lookup table: