We're updating the issue view to help you get more done. 

Improve Session opening efficiency

Description

Opening a new Session has become quite resource intensive: several configuration properties are being duplicated and parsed, and it turns out most of these operations are going to be the same for all Session instances when opened with the default settings.

This can be improved in various ways; I'm planning to introduce a new component to be layered between the SessionFactory and the Session instances. In terms of roles this is similar to the SessionBuilder, except that the builder is by its nature unique for each Session and is collecting settings which make a Session unique - while the new component (planned to be called FastSessionServices ) is having a design emphasis on the immutable state to be shared across all Sessions (unless they use special flags to diverge).

Such new component can als be used to cache / prepare frequently looked up elements from the SessionFactory, such as particularly hot Services or anything similarly threadsafe, unique.

Configuration properties of a Session also need to be called out: literally having to parse Map<String, Object> props at each session open is not great for performance; not least each session is having its own copy of such properties, while we could use a copy-on-write approach to share the default settings among all sessions.

Environment

None

Status

Assignee

Sanne Grinovero

Reporter

Sanne Grinovero

Fix versions

Labels

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Priority

Major