How is this on memory? I'm not sure how much memory each mock takes, but especially in a large test suite, this array will grow rather large.

Rereading the pull request, I don't disagree with the idea. Maybe instead of always caching it, we can have a flag that will turn the functionality on. As long as it's understood that this might greatly increase the memory footprint.