Improved efficiency of frequently-called functions based on profiling.
Improved efficiency of frequently-called functions based on profiling.

* Updated to cache key as a member.
* Fixed equality to be type invariant.

afbarnard/esal