Discussion Boards > General Archi Discussion

Jarchi - Performance

(1/3) > >>

rfamans:
Hi,

I have created several Jarchi scripts that traverse through a medium size Archi model (apx. 2500 elements and 6000 relationships). The structure of my Jarchi code looks more or less like this:

    $('.'+element.name).inRels().filter('flow-relationship').each(function(flow) {
        source = flow.source.name;
        $('#'+flow.id).outRels().filter('association-relationship').each(function(assoc) {
           var intf = $('.'+assoc.target.name).filter('application-interface').first();
           $('.'+intf.name).outRels().filter('access-relationship').each(function(accesses) {
              var pobj = $('.'+accesses.target.name).filter('business-object').first();
           });
        });
     });

It seems that traversing this way through a medium size Archi model is exhausting my workstation's resources in such way that processing a single top level element with 2 child levels below (each sublevel has max 20 elements) can take up to one hour.

From a distance it looks like Jarchi runs into memory management issues because I am re-instantiating (big??) object variables in a nested loop structure.

Does somebody have a clue about what may be the cause of the heavy load that these kind of Jarchi scripts do generate? Is there a workaround that can be used to reduce the heavy system load?

// Roy

Phil Beauvoir:
At this point it's hard to say if there is an overhead from the Java libraries involved or something else in the script.

I suggest opening an issue here - https://github.com/archimatetool/archi-scripting-plugin/issues - together with an attached example model and full script that demonstrates the problem. Then we can take a look at what's going on.

Phil Beauvoir:
Perhaps you could check those nested calls by inserting some log messages.

Phil Beauvoir:
A quick comment.

In your code you are not using some variables. Instead of:

$('#'+flow.id).outRels()

You could do:

$(flow).outRels()

And instead of:

$('.'+intf.name).outRels()

You could do:

$(intf).outRels()

rfamans:
Thanks for your reply. I will try your suggestion and let you know if it improves the script performance.

Navigation

[0] Message Index

[#] Next page

Go to full version