Hi
In one of our tests there is a “massive” inserts (~25000 rows) that we find quite long (several minutes), so we started profiling.
It appears that this eclipse method is a hot spot: org.eclipse.persistence.descriptors.ClassDescriptor.getMappingForAttributeName.

Which by looking at the code is not surprising
* PUBLIC:
* Returns the mapping associated with a given attribute name.
* This can be used to find a descriptors mapping in a amendment method before the descriptor has been initialized.
*/
public DatabaseMapping getMappingForAttributeName(String attributeName) {
// ** Don't use this internally, just for amendments, see getMappingForAttributeName on ObjectBuilder.
for (Enumeration mappingsNum = mappings.elements(); mappingsNum.hasMoreElements();) {
DatabaseMapping mapping = (DatabaseMapping)mappingsNum.nextElement();
if ((mapping.getAttributeName() != null) && mapping.getAttributeName().equals(attributeName)) {
return mapping;
}
}
return null;
}
This method as a linear complexity while it is called systematically it seems. Using a HashMap instead of iterating over an Enumeration could drastically improve performance.
Incidentally, this is how the same method is implemented in org.eclipse.persistence.internal.descriptors.ObjectBuilder
Best Regards
Michael