Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [milo-dev] Browse example performance

Yes, I noticed it myself too - sorry about this.

 

https://gist.github.com/crimbletime/1c176d5d74007ce824350fde3b8f28dd

 

I am using a UAGateway to bring OPC-DA into UA and the machine that is running it uses about 2-3% CPU. So, I doubt there will be issues with its load.

 

As a novice in Java 8 it is a bit hard for me to turn my head around CompletableFuture. Probably will spend few days of turning it around myself, but any starting point will be appreciated.

 

Regards

 

Mario

 

From: milo-dev-bounces@xxxxxxxxxxx [mailto:milo-dev-bounces@xxxxxxxxxxx] On Behalf Of Kevin Herron
Sent: Tuesday, November 29, 2016 5:31 PM
To: milo developer discussions
Subject: Re: [milo-dev] Browse example performance

 

Mario,

 

The mailing list seems to have really destroyed the formatting of that code - can you paste it into a gist (https://gist.github.com/) instead?

 

3-4 hours seems very slow, but you're likely to be limited to the speed of the server in this case. You might be able to parallelize the client so that it starts browsing branches concurrently (perhaps with some limitation on how many operations are happening at once) but whether or not the server could tolerate this load is not something I could answer.

 

On Tue, Nov 29, 2016 at 9:23 AM, Mario Kostadincev <mario.kostadincev@xxxxxxxxxxxx> wrote:

Hello all!

I wonder how the building of a hierarchical tree which looks in my case
something like this:



        MOpcDir browseNode(int level, MOpcDir mn, OpcUaClient client, NodeId
browseRoot) {
                BrowseDescription       browse = new
BrowseDescription(browseRoot, BrowseDirection.Forward,

Identifiers.References,
                                                        true,

uint(NodeClass.Object.getValue() | NodeClass.Variable.getValue()),

uint(BrowseResultMask.All.getValue()));
                level++;
                try {
                        BrowseResult browseResult =
client.browse(browse).get();
                        try {
                                for (ReferenceDescription rd :
browseResult.getReferences()) {

                                        String n =
rd.getBrowseName().getName();
                                        String t =
rd.getNodeClass().toString();
                                        MOpcDir currentnode = new
MOpcDir(n);
                                        int lvl= level;
                                        if (t == "Object")
                                        {

rd.getNodeId().local().ifPresent(nodeId -> {
                                                        // recursively
browse to children

mn.add(browseNode(lvl, currentnode,client, nodeId));
                                                });
                                        }
                                        if (t == "Variable")
                                                mn.add(new MOpcVariable(n));
                                }
                        } catch (Exception e) {
                                                        }

                } catch (InterruptedException | ExecutionException e) {
                        logger.error("Browsing nodeId={} failed: {}",
browseRoot, e.getMessage(), e);
                }

                        level--;

                return mn;


        }

...can be transformed by using CompletableFuture to speed-up scanning of a
large OPC structure (currently around 220k elements and takes around 3-4
hours).

Kind regards

Mario Kostadincev

_______________________________________________
milo-dev mailing list
milo-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/milo-dev

 


Back to the top