Consider caching config options for hot code paths

Description

Typesafe config re-parses properties each time they are accessed (see here). This adds a tiny performance overhead.

Assess if this overhead is significant in the driver, in particular in hot code paths such as request execution. For example, we read the request timeout each time we start executing a request:

If so, add a cache to avoid reading from the configuration each time. Refresh the cache when needed (this will likely require a hook to detect when the configuration gets reloaded). Test again to check if the cache brings an improvement.

This is an exploratory ticket, not a hard requirement. Caching might not bring any significant advantage, or it might even be worse.

Environment

None

Pull Requests

None

Activity

Show:
Olivier Michallat
June 28, 2017, 6:01 PM

Refresh the cache when needed (this will likely require a hook to detect when the configuration gets reloaded)

added that hook: register a ConfigChangeEvent listener with the event bus. See ChannelPool for an example.

Fixed

Assignee

Olivier Michallat

Reporter

Olivier Michallat

Labels

None

PM Priority

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Minor
Configure