Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] [DB] Optimization ([CDO] [DB] Optimization )
[CDO] [DB] Optimization [message #486835] Sat, 19 September 2009 17:45 Go to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
I'm starting to use DB and I found that the following is VERY VERY SLOW

If I'm adding 20000 thousand at the end of a list...I look at the code and it will do the following for each entry.

NonAuditListTableMapping

move1up(accessor, id, index, UNBOUNDED_MOVE);
insertValue(accessor, id, index, value);


move1up is EXTREMELY slow to run....
My Question... when we add at the end of the list... why
move1up(accessor, id, index, UNBOUNDED_MOVE);
need to be executed for ALL elements ???

(I'm using H2)
Re: [CDO] [DB] Optimization [message #486836 is a reply to message #486835] Sat, 19 September 2009 17:57 Go to previous messageGo to next message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
I did a test to see if it was really the problem by adding a lookup if the previous size in bigger then the new one...

private void move1up(IDBStoreAccessor accessor, CDOID id, int index, int upperIndex)
{
PreparedStatement stmt = null;
CDORevision readRevision = accessor.getStore().getRepository().getRevisionManager().get Revision(id, -1);
int size = readRevision.data().size(getFeature());
if (size > index)
{
...NORMAL CODE
}
}

and now it is 10000 times faster.
it need probably to be smarter than that... but still !
So this is a problem in there !! Smile
Re: [CDO] [DB] Optimization [message #486874 is a reply to message #486836] Sun, 20 September 2009 14:56 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6683
Registered: July 2009
Senior Member
Hi Simon,

That really sounds like something we should optimize. Can you file a
bugzilla against DBStore?

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Simon Mc Duff schrieb:
> I did a test to see if it was really the problem by adding a lookup if
> the previous size in bigger then the new one...
>
> private void move1up(IDBStoreAccessor accessor, CDOID id, int index,
> int upperIndex)
> {
> PreparedStatement stmt = null;
> CDORevision readRevision =
> accessor.getStore().getRepository().getRevisionManager().get
> Revision(id, -1);
> int size = readRevision.data().size(getFeature());
> if (size > index)
> {
> ...NORMAL CODE
> }
> }
>
> and now it is 10000 times faster.
> it need probably to be smarter than that... but still !
> So this is a problem in there !! :)
>


Re: [CDO] [DB] Optimization [message #486955 is a reply to message #486836] Mon, 21 September 2009 09:51 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi Simon,

nice one. I was aware of the problem, but I did not know about a way to
get hold of the revision and -- hence -- the size of the list to
implement the condition.
With your way, I can even simplify the whole thing, because if I know
the size of the list, I don't need to make a difference between move1up
w/ or w/o upper bound.

Cheers,
Stefan


Simon Mc Duff schrieb:
> I did a test to see if it was really the problem by adding a lookup if
> the previous size in bigger then the new one...
>
> private void move1up(IDBStoreAccessor accessor, CDOID id, int index,
> int upperIndex)
> {
> PreparedStatement stmt = null;
> CDORevision readRevision =
> accessor.getStore().getRepository().getRevisionManager().get
> Revision(id, -1);
> int size = readRevision.data().size(getFeature());
> if (size > index)
> {
> ...NORMAL CODE
> }
> }
>
> and now it is 10000 times faster.
> it need probably to be smarter than that... but still !
> So this is a problem in there !! :)
>
Re: [CDO] [DB] Optimization [message #486957 is a reply to message #486955] Mon, 21 September 2009 10:01 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6683
Registered: July 2009
Senior Member
Guys,

Do we have a bugzilla for this?

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Stefan Winkler schrieb:
> Hi Simon,
>
> nice one. I was aware of the problem, but I did not know about a way to
> get hold of the revision and -- hence -- the size of the list to
> implement the condition.
> With your way, I can even simplify the whole thing, because if I know
> the size of the list, I don't need to make a difference between move1up
> w/ or w/o upper bound.
>
> Cheers,
> Stefan
>
>
> Simon Mc Duff schrieb:
>
>> I did a test to see if it was really the problem by adding a lookup if
>> the previous size in bigger then the new one...
>>
>> private void move1up(IDBStoreAccessor accessor, CDOID id, int index,
>> int upperIndex)
>> {
>> PreparedStatement stmt = null;
>> CDORevision readRevision =
>> accessor.getStore().getRepository().getRevisionManager().get
>> Revision(id, -1);
>> int size = readRevision.data().size(getFeature());
>> if (size > index)
>> {
>> ...NORMAL CODE
>> }
>> }
>>
>> and now it is 10000 times faster.
>> it need probably to be smarter than that... but still !
>> So this is a problem in there !! :)
>>
>>


Re: [CDO] [DB] Optimization [message #486964 is a reply to message #486957] Mon, 21 September 2009 10:48 Go to previous message
Simon Mc Duff is currently offline Simon Mc DuffFriend
Messages: 596
Registered: July 2009
Senior Member
Bugzilla created
https://bugs.eclipse.org/bugs/show_bug.cgi?id=289985
Previous Topic:Ecore2Ecore data migration when reference's type is removed
Next Topic:[CDO] Timeout while getting worker Thread?!
Goto Forum:
  


Current Time: Tue May 07 10:01:15 GMT 2024

Powered by FUDForum. Page generated in 5.04933 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top