Open
Description
Introduction:
There are some instructions in the code, that can be executed once in init-time rather than every time in running:
- evictionConfig is been recreated every time in eviction-phase.
- EvictionPolicy is being looked in map every time in eviction-phase. Map operations aren't so fast as we might think: they calculate hash, look object in buckets by the hash.
- Something else?
Problem:
Probably, it's not reasonable to do these operations every time, because the config is been changed hardly ever after pool is created.
Possible solution:
- Create such objects once in startEvictor(). So, when you change config - just restart evictor;
- Make a new method to apply config changes. So, when you change config - just call the method;
- Another solution?