Improved typemapping performance