use hashmap to speed up lru_cache
Merge pull request #598 from sangkilc/cache-improve

use hashmap to speed up lru_cache