Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-dev] FYI: uow.discoverUnregisteredNewObjects is inefficient and with side effect

getBackupClone() does not actually build anything, it just looks for the backupClone.  It is just a validation step and has not been added but moved out of the "normal" processing stream to improve performance and efficiency.

--Gordon

Sebastien Tardif wrote:

FYI: uow.discoverUnregisteredNewObjects is inefficient and with side effect

 

    /**

     * INTERNAL:

     * Traverse the object to find references to objects not registered in this unit of work.

     */

    public void discoverUnregisteredNewObjects(Map clones, final Map knownNewObjects, final Map unregisteredExistingObjects, Map visitedObjects) {

 

The JavaDoc and signature seem to convey that the only change will be to populate the Maps passed as parameters.

 

The inefficiency is that in revision 2794 this line has been added:

 

getBackupClone(object, getCurrentDescriptor());

 

We see that we ignore the return value, and we can guess that building a clone is not the cheaper operation.

 

Method discoverUnregisteredNewObjects end-up modifying the UOW by doing this: setUnregisteredExistingObjects(unregisteredExistingObjects);

 

The list of unregisteredExistingObjects will be returned anyway, so that doesn’t seem to be the responsibility of discoverUnregisteredNewObjects to apply some logic with the result.

 


_______________________________________________ eclipselink-dev mailing list eclipselink-dev@xxxxxxxxxxx https://dev.eclipse.org/mailman/listinfo/eclipselink-dev

Back to the top