Fast case-insensitive hash-code for specific codes
There isn't much left to optimize there, just few cycles, but with 40 millions calls the difference might be at least measurable.

When value.length == 3 you perform &lt;&lt; 8 twice and csc or JIT compiler have no chance to optimize this, given that length can be only 2 or 3 then you can make it explicit (I think you will also gain in clarity but that's just a point of view):

public static int Encode(this string value)
{
    Debug.Assert(value != null);
    Debug.Assert(value.Length == 2 || value.Length == 3);

    if (value.Length == 2)
    {
        return ((int)value[0] &lt;&lt; 8)
            | EncodeLetter(value[1]);
    }
    else
    {
        return ((int)value[0] &lt;&lt; 16)
            | ((int)value[1] &lt;&lt; 8)
            | EncodeLetter(value[2]);
    }

    int EncodeLetter(char c)
        =&gt; c &gt; 'Z' ? (return c - CaseFix) : (c);
}


In this way you should save one shift &lt;&lt; (which isn't super-fast in all .NET environments). Also direct access to string items without value.Length - 1 should be slightly faster. Bitwise OR | may be faster than sum + but it depends on an huge amount of details (specific CPU, in primis, and how uop will be fused with surrounding code)...not something we can determine without more details. Here I like it only because of clarity.

It would be nice if we may get the JIT compiler to drop bounds checking here, is unsafe code allowed here?

I added few Debug.Assert(), not a penalty price you want to pay in released code but probably useful when running tests on your own development machine.

About Decode(): "9Z".Encode() might be saved in a static readonly field (in my case it seems it's not optimized away by compiler/JIT).