Memory and RTT Comparions with .NET and UA Expert

Questions regarding the use of the Java SDK for Server or Client development or integration into customer products ...

Moderator: uasdkjava

Post Reply
tooLate
Sr. Member
Sr. Member
Posts: 10
Joined: 10 Jun 2013, 15:09

Memory and RTT Comparions with .NET and UA Expert

Post by tooLate »

Hallo

so I am currently comparing the JAVA SDK and the .NET SDK and I have a few questions.

The two SDKs differ in two points.

1. Memory

- .NET SDK and 50,000 nodes, and the memory usage does not go above 300 MB running any performance tests with UA Expert. It looks like the garbage collector does a good job.

- :JAVA SDK and 50,000 nodes, either with UaNodes or with the MyBigNodeManager example, the memory usage goes as high as it needs and stays there. For example around 1,5 GB after running some read and write performance tests with UA Expert

2. RTT (Roundtrip Time)

- .NET is slower by 7 times, needing around 700 ms to read or write 50,000 nodes

- .JAVA takes about 100ms -150ms to read or write the same amount of 50,000 nodes

So it seems to me, since I have to work with a large number of nodes that I would like to stick to the JAVA SDK, if I can get the memory usage managed somehow.

Does anybode can help me in any way ?

Another problem I have is, running the Java Server from a .jar file generated by NetBeans.
Running the .jar file server, the RTT is around 3x times higher like 400ms - 500ms compared to running the server in NetBeans.

Does anybode know why ? I could not find any information about this online yet.

Thanks

kind regards

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Memory and RTT Comparions with .NET and UA Expert

Post by Support Team »

Hallo tooLate,

your measurements are not even close to our own performance results, so oviously you are comparing different things.

- First you should measure release compiled test candidates only.
- Second you should not attach with debugger and you should switch of trace during measurement.
- Third you should use same DataType for all nodes when measuring and you should use same NodeID length and type.
Otherways the result is not comparable.

How do you measure memory?
Which nodes are you using for RTT measurement?

Best Regards
Support Team

tooLate
Sr. Member
Sr. Member
Posts: 10
Joined: 10 Jun 2013, 15:09

Re: Memory and RTT Comparions with .NET and UA Expert

Post by tooLate »

Hallo

to anwser your questions,

- I use 50,000 Variables with double values for both SDK servers.
- I also should mention that I test the setup over a small LAN, so on the local computer the RTT results are of course much faster.
- I am pretty sure that I have deactivated all trace options in the .NET SDK APP.CONFIG file, as for JAVA I am not sure yet, I will check.
- I also think that both the .NET and JAVA SDK use string representation of the NodeIDs.
- Finally I run the .NET SDK server build as a release and not for Debug and I simply look on the ressourcemonitor provided by MS Windows.

best regards

Randy
Jr. Member
Jr. Member
Posts: 4
Joined: 27 Mar 2013, 23:57

Re: Memory and RTT Comparions with .NET and UA Expert

Post by Randy »

There are many ways to implement a NodeManager in the .NET SDK and it is possible that your implementation is not optimal for the use case of reading 50K points fast.
It is possible to design a NodeManager that will perform much better on these kind of Read tests but you will be sacrificing other features (i.e. ease of development).

The results that I get with UA Expert and the .NET SDK with a NodeManager designed for fast access to data is about 2x slower than the ANSI C implementation.

tooLate
Sr. Member
Sr. Member
Posts: 10
Joined: 10 Jun 2013, 15:09

Re: Memory and RTT Comparions with .NET and UA Expert

Post by tooLate »

Hi

can you give some numbers how fast your ansi-c and .NET implementations are ? So I can get a feeling for what is possible.

User avatar
Support Team
Hero Member
Hero Member
Posts: 3064
Joined: 18 Mar 2011, 15:09

Re: Memory and RTT Comparions with .NET and UA Expert

Post by Support Team »

The different SDKs have their advantages in different diziplines. The ANSI C SDK is designed for single threaded use on embedded devices, it has best performance when representing one single data source. On PC hardware it is extremely fast and it will have the lowest memory consumption, but it will not participate from multi core CPU as one single task can not be scheduled accross multiple cores. For the test you are doing (one client reading large number of nodes) it will be the fastest you can get and it scales linear with the number of nodes. On my i7 at 3.4GHz I can read your 50.000 single nodes within approx. 50ms, and when reading large nodes the throughput will be even faster and you will reach the maximum close to GBit Ethernet.

The .NET stack is designed to support a large number of clients. This means that there are thread context switches when a request
arrives and is assigned to a thread pool. In addition, there is another context switch when writing the response because the .NET stack is designed to allow a single client to send multiple requests that are processed simultaneously. When measuring with a single client doing sequential requests the .NET SDK will perform 2-3 times slower than the AnsiC SDK, however the .NET SDK can not show its advantages when it comes to parallel multithreaded handling of requests being scheduled accross multiple cores of the PC.

Finally it depends on the use cases which SDK will be the best choice. You should be making decisions based on a variety of criteria. Raw performance numbers for a single (possibly unrealistic) test case might be misleading.

Best Regards
Supprot Team

Post Reply