Add reference caching.
Add entries caching as well.

Huzzah for fast and memory intense!