+
Skip to content

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

Open
@PROger4ever

Description

@PROger4ever

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?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载