in org.hibernate.mapping.PersistentClass some 2 performance issues can be fixed

Description

3 performance issues in org.hibernate.mapping.PersistentClass:

1. The mappedClass is loaded again and again calling ReflectHelper.classForName(className). The mapped class is not changed so it should be hold as member variable.

2. Method getProperty(String, Iterator) uses a MappingException which is ignored in getRecursiveProperty(String, Iterator). This makes the recursion more expensive than required.

3. Method getProperty calls StringHelper.root( propertyName ) for every property. Simply change the while in if do while.

A fix is provided as attachment.

Environment

None

Activity

Show:
Anton Marsden
August 6, 2013, 11:11 AM

A pull request has been added for this: https://github.com/hibernate/hibernate-orm/pull/557

Brett Meyer
August 19, 2013, 7:52 PM

Thanks for the patch and PR!

Assignee

Brett Meyer

Reporter

Christoph W.

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure