Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimization: prepare config in init-time rather than in run-time #39

Open
PROger4ever opened this issue Sep 24, 2018 · 0 comments
Open

Comments

@PROger4ever
Copy link

Introduction:
There are some instructions in the code, that can be executed once in init-time rather than every time in running:

  1. evictionConfig is been recreated every time in eviction-phase.
  2. 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.
  3. 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:

  1. Create such objects once in startEvictor(). So, when you change config - just restart evictor;
  2. Make a new method to apply config changes. So, when you change config - just call the method;
  3. Another solution?
@PROger4ever 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants