Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 366840

Summary: Improve performance of CDOTransactionImpl.getID(InternalCDOObject, boolean)
Product: [Modeling] EMF Reporter: Eike Stepper <stepper>
Component: cdo.coreAssignee: Victor Roldan Betancort <vroldanbet>
Status: CLOSED FIXED QA Contact: Eike Stepper <stepper>
Severity: enhancement    
Priority: P3 CC: rkrijgsheld
Version: 4.0Flags: stepper: review+
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch v1 none

Description Eike Stepper CLA 2011-12-15 12:26:05 EST
Cloned from: 366803: Improve performance of CDOTransactionImpl.getID(InternalCDOObject, boolean)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=366803

Recent profiling sessions in one of our applications reveal a big performance bottleneck in org.eclipse.emf.internal.cdo.transaction.CDOTransactionImpl.getID(InternalCDOObject, boolean), and more specifically in the following code snippet:

if (getDetachedObjects().containsValue(object))
{
  CDORevisionKey revKey = cleanRevisions.get(object);
  if (revKey != null)
  {
    id = revKey.getID();
  }
}

This bottleneck appears with big commits with lots of changes, where getDetachedObjects() returns a big collection.

Any enhacement should be backported to 4.0 too, as long as its technically possible.
Comment 1 Victor Roldan Betancort CLA 2011-12-16 10:36:29 EST
Created attachment 208492 [details]
patch v1

using git diff
Comment 2 Victor Roldan Betancort CLA 2011-12-29 06:58:11 EST
ping!
Comment 3 Victor Roldan Betancort CLA 2012-02-29 10:51:59 EST
ping :(
Comment 4 Eike Stepper CLA 2012-03-02 13:05:52 EST
Sorry for the delay!!!
Comment 5 Ronald Krijgsheld CLA 2012-03-02 13:55:04 EST
maybe in addition to your patch additional performance improvement is possible. 

implement a method isDetachtedObject(). 

At the moment the detachedObjects Map is constructed every time when a call to to getDetachedObjects() is done via lastSavePoint.getAllDetachedObjects().

the isDetachedObject() could return a boolean without the need for first building the Map.
Comment 6 Victor Roldan Betancort CLA 2012-03-05 06:06:00 EST
Committed to Master, c9ef64734d58570258cff0cc4a3fe24024512ae7
Comment 7 Victor Roldan Betancort CLA 2012-03-05 06:07:29 EST
Ronald, could you please create a separate bugzilla for your performance enhancement proposal? Thanks!
Comment 8 Eike Stepper CLA 2012-09-21 06:51:39 EDT
Closing.