You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
PROger4ever
changed the title
Optimization: prepare objects in init-time rather than in run-time
Optimization: prepare config in init-time rather than in run-time
Sep 24, 2018
Introduction:
There are some instructions in the code, that can be executed once in init-time rather than every time in running:
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:
The text was updated successfully, but these errors were encountered: