Avoid allocation of empty vararg arrays for reflective invocations without parameters

Description

The reflective helper

1 Object invoke(Object target, Object... parameters)

, which is quite hot in various code points across Hibernate to read the value from getter methods, has the invoker implicitly allocate an empty array to be passed to the vararg supporting argument when there are no arguments.

In most cases we'll invoke these helpers without expecting any argument, so it's worth adding an overloaded method which optimises for the common use case.

Environment

None

Status

Assignee

Sanne Grinovero

Reporter

Sanne Grinovero

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Fix versions

Affects versions

5.0.0.Final

Priority

Major