gh-pages / com.nextfaze.devfun.inject / CacheLevel
CacheLevel
enum class CacheLevel
(source)
Controls how aggressively the CompositeInstanceProvider caches the sources of class instances.
-
AGGRESSIVE Once a type has been found from a provider, that provider will checked before others. If it returns
null
the next time then the lookup will continue be as if NONE. Can result in a significant performance improvement. -
SINGLE_LOOP Behaves the same as AGGRESSIVE, but is thread-local and caching is only present once per top-level call. i.e. If something calls
devFun.get<Type>()
- for that one “top-level” call (and thus present for recursion). This will likely resolve any issues you have with AGGRESSIVE while still providing a small improvement - please report any issues! -
NONE No caching - all providers are checked in reverse order they are added as normal. Can be quite slow for complex hierarchies (e.g. large Dagger graphs).
The cache level can be changed on the fly via DevFun.
Enum Values
Name | Summary |
---|---|
AGGRESSIVE | |
SINGLE_LOOP | |
NONE |