Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Improve performance during loading
[CDO] Improve performance during loading [message #1424905] Tue, 16 September 2014 15:34 Go to next message
Enrique Dela is currently offline Enrique DelaFriend
Messages: 3
Registered: September 2014
Junior Member
Hi everyone,

i'm using CDO since 1 month and EMF since 6 months with little models. Now i have to handle models with something like 1 million entries.

Actually when i load my model with this :

CDOResource resource2 = transaction.getResource("model", true);


it takes 2 minutes (this seem's correct for 1 million input). But i don't understand something (maybe i don't understand how EMF works) but my meta_model look like this :

index.php/fa/19142/0/


In my model i have only 1 Solution, 2 artifact and for each artifact 500 000 References. I expected that CDO will only load the solution with artifact proxy (and load later thank to lazy-loading). But it's seems that the artifacts are loaded, is it normal ? maybe "container reference" means that the objects links are automatically loading (All my Erefrence have flag "Resolve proxy" set to false) and the lazy loading only works with cross-document references. If someone can explains to me how works the loading for containment reference and if we can use lazy loading for this kind of reference.

Here my GenModel configuration :

index.php/fa/19143/0/

So in order to improve the loading i'm using

			CDOCollectionLoadingPolicy policy = CDOUtil.createCollectionLoadingPolicy(0, 300);
			_session.options().setCollectionLoadingPolicy(policy);


But this is no more efficient, i don't know if someone have some idea to improve the loading ? I only want to load my reference when i click on my artifact and call: artifact.getReference();

Thanks.
  • Attachment: eclipse.png
    (Size: 4.89KB, Downloaded 304 times)
  • Attachment: elcipse2.png
    (Size: 18.10KB, Downloaded 322 times)
Re: [CDO] Improve performance during loading [message #1425459 is a reply to message #1424905] Wed, 17 September 2014 10:46 Go to previous messageGo to next message
Per Sterner is currently offline Per SternerFriend
Messages: 91
Registered: October 2011
Member
This should execute nearly instant:
CDOResource resource2 = transaction.getResource("model");


For 500000 entries this should execute instant:
Artifact artifact = ...;
// Nearly Instant:
refs = artifact.getReference();
it = refs.iterator();


This could take a while:
// Not recommended :-)
Object[] arr = refs.toArray();
Re: [CDO] Improve performance during loading [message #1426145 is a reply to message #1425459] Thu, 18 September 2014 10:01 Go to previous messageGo to next message
Enrique Dela is currently offline Enrique DelaFriend
Messages: 3
Registered: September 2014
Junior Member
Quote:
This should execute nearly instant:
Code: [Select all] [Show/ hide]

CDOResource resource2 = transaction.getResource("model");


it's not instant and i don't understand why. Maybe i should add option on my reference. But in memory my object took 400Mo ... My Artifact is not an eProxy and i don't understand why

I'm reading the EMF Book and found this :

Quote:
References can also be persisted across multiple resources (documents), where demand load and proxy resolution come into play.


Quote:
Although, as we saw earlier, objects in containment references are implicitly included in their container's resource by default, it is also possible to enable cross resource containment. In Chapters 10
and 15 , we'll explore this topic, and look at demand loading, proxies, and proxy resolution in greater detail


Quote:
The default EList implementation for containment references, used here, does not resolve proxies. This is because cross-resource containment support must be explicitly enabled for a model. This is done from within the EMF
generator, via a property on the root - level GenModel object. [9]The value of the "Containment Proxies" property determines whether any containment references in the model can be proxy resolving. If it is true, then any
EReference in the model for which resolveProxies is true will support cross-resource containment


I assume that i have to split my resource in CDO to optimize the loading.

[Updated on: Thu, 18 September 2014 13:04]

Report message to a moderator

Re: [CDO] Improve performance during loading [message #1426805 is a reply to message #1426145] Fri, 19 September 2014 08:35 Go to previous messageGo to next message
Per Sterner is currently offline Per SternerFriend
Messages: 91
Registered: October 2011
Member
CDO handles lazy loading on it's own way. You can have a containment list with millions of entries. You can configure how many items should be preloaded with 'options()' on the CDOSession or CDOView/CDOTransaction.

If you start Iterating over a huge reference or containment list, it is possible.
Re: [CDO] Improve performance during loading [message #1428945 is a reply to message #1426805] Mon, 22 September 2014 15:24 Go to previous message
Enrique Dela is currently offline Enrique DelaFriend
Messages: 3
Registered: September 2014
Junior Member
Thanks Per,

You are right, in fact my problem is due to my transactionnalEditingDomain when the ChangeRecorder call the method beginRecording during initialization. Without EditingDomain everything works fine.
Previous Topic:adding to the EMF registry
Next Topic:EMF complete model
Goto Forum:
  


Current Time: Fri Aug 23 23:59:15 GMT 2019

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

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

Back to the top