See discussion in https://github.com/pydata/pandas/issues/14266.

IndexEngine.get_loc currently does lookups without building a hash table for large indices, as does DatetimeEngine.__contains__. get_indexer, however, still always populates a table, as does __contains__ on non-datetime indices.

Comment From: jbrockmendel

__contains__ now directly calls get_loc, avoiding creating a hashtable in the same set of cases. get_indexer always uses a mapping though