emmby/guice — pull request #1 by emmby (2014-02-07 22:47:31+00:00)
Title: Injectable Member Caching

Introduce several layers of caching during static class scanning to speed up performance. Big performance gains are seen on Android where many reflection methods can be slow.

1. Cache calls to Class.getGenericSuperclass in TypeLiteral and MoreTypes
1. Modify InjectionPoint.getInjectionPoints to memoize previous results so that types that were previously scanned do not need to be scanned again.
1. Add some additional tests to InjectionPointTests to catch corner cases.

I removed some optimizations that were present in the previous InjectionPoint code in order to facility other optimizations with bigger performance benefits. For example, I removed the custom linked list implementation in favor of java.util.LinkedList so that lists of InjectableMembers could be cached and re-used. We can investigate re-enabling some of these optimizations if necessary.

Performance Results:
* [add some notes about perf results]

Notes for further optimization:
* modify getInjectionPoints so that you only need to call it once instead of once for non-statics and once for statics?