[engine] using memoized to avoid repeated keying and unpickling

Review Request #3597 — Created March 23, 2016 and discarded — Latest diff uploaded

peiyu
pants
3066, 3078
pants-reviews
kwlzn, patricklaw, stuhood

This is yet another low hanging fruit but effective performance
improvement in Storage.

In my manual testing list 3rdparty::, improvement for cold cache is
about 50%, for fully warmed-up cache, it's sightly slower because of the
extra memoized check cost.

Using memoized is only for now, there are various lru_cache
implementations for py2 that we could use later, like [1] and [2]
or just switch to py3.

[1] https://github.com/repoze/repoze.lru
[2] https://pypi.python.org/pypi/functools32

http://jenkins.pantsbuild.org/job/pants_ci.unit_tests/140/ passed

Loading...