cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mega Internals - Memory Allocation Or Building Collection

DMHolling
Super Contributor

I am writing a script that is expected to process a large amount of information and involve a large number of repository objects, particularly in ad-hoc collections. To ensure efficient and quick execution I would like to understand the internal schemes for creating object collections that are returned under different scenarios, which are:

 

- run a database query using oObject.GetSelection("Select ..."): pass memory reference to prexisting collection or generate collection (assume the latter) ?

 

- get all objects of a specific class e.g. Org-Unit connected to an object (from the root or any other object) e.g. oObject.GetCollection("Org-Unit") - is this a pre-existing collection to which a memory reference is returned or is the collection, created, built and returned?

 

- a collection of mixed class types related to an object e.g. oObject.GetProp("Dependency") or oObject.GetCollection("Aggregation Of") - reference to pre-existing collection or collection built on request?

 

Is there any advice on which methods are to be preferred for efficiency reasons?

 

Thanks in advance

1 Reply

selhatimi
MEGA
MEGA

hello Mr. HOLLONG,

 

I inform you that when we call a collection of type object.getCollection(“Org-Unit”) for the first time the collection is created and saved in the cache: if we call it another time it’s not created but referenced from the cache.

 

For the collection of type  object.getCollection(“Select…”), for each execution a new collection is created

So the first type of collection is the more optimal

There is no difference between a collection of a specific class or a collection of mixed  class types.

 

Sami