Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Global map for caching elements
[ATL] Global map for caching elements [message #799770] Thu, 16 February 2012 09:39
Stefan WülfrathFriend
Messages: 18
Registered: February 2012
Junior Member

I have created an ATL transformation for transforming MOF (Managed Object Format) models to CIM (Common Information Model) models.
It works for now but I have a big transformation performance issue.

My target metamodel (CIM) contains following metaclasses: "Class", "Qualifier" and "QualifierType"

My source metamodel (MOF) has some related metaclasses: "ClassDeclaration", "Qualifier", "QualifierDeclaration".

Each cim!Class can contain zero to many qualifiers (cim!Qualifier). Each qualifier is related to a cim!QualifierType.

My parser which parses the MOF files into my intermediate MOF model cannot resolve this relation. So my MOF model doesn't contain this reference.

Now the transformation should solve this problem by taking a mof!Qualifier and searching for a mof!QualifierType that has same name.

My ATL code:
rule ClassDecl2Class {
    classDecl : mof!ClassDeclaration 
    class : cim!Class (
      Name <-,
      SuperClass <- classDecl.superClass,
      OwnedQualifier <- classDecl.classQualifiers

rule QualifierDecl2QualifierType {
    decl : mof!QualifierDeclaration (
    qualifierType : cim!QualifierType (
      Name <-,
      OwnedType <- decl.qualifierDataType,
      OwnedDefaultValue <- decl.qualifierDefaultValue
rule Qualifier2Qualifier {
    mofQualifier : mof!Qualifier
    cimQualifier : cim!Qualifier (
      Name <-,
      -- The next line causes the performance impact
      QualifierTypeRef <- cim!QualifierType->allInstances()->select(qt | qt.Name.toLower() =>first(),
      QualifierValue <- mofQualifier.qualifierParamValue

As you can see I iterate over all cim!QualifierTypes and looking for that one having the same name. This works as expected but causes a performance impact. I have measured that one cim!Qualifier generation needs 1 second with this line included. When this line is omitted the generation is very fast.

Unfortunately I have to transform 1000 classes and their members (the so called Common Schema). They own all together more than 32,000 qualifiers! So it would take 32,000 seconds to transform...

I think the problem is the iteration over all existing Qualifier Types. So my idea is to create a global hash map which contains all qualifier types and to use this map when resolving the "QualifierTypeRef" reference. This should improve performance significantly.

So my question is: How do I declare such a global map and how do I have to use it?

Thank you very much for your help in advance!

Previous Topic:[QVTo] Disambiguation of black-box operations
Next Topic:ATL too slow when transforming
Goto Forum:

Current Time: Sat Mar 02 05:02:04 GMT 2024

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

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

Back to the top