Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
AddReference and AddNewReference differences
May 22, 2017
12:26, EEST
Avatar
Xavier
Member
Members
Forum Posts: 43
Member Since:
March 26, 2014
sp_UserOfflineSmall Offline

Hello,

I had a performance problem when creating a server with 30 000 references created from always the same object to around 15 000 different objects (1 custom reference and 1 hasEventSource reference). I was gonna ask here but then I found the addNewReference method. What was taking 25 minutes is now taking a few hundreds milliseconds so it’s perfect.

I believe that the performance cost is that when using addReference it has to check all existing references before creating a new one. With addNewReference I think that it is added without testing which is way faster when you have thousands of references.

The addNewReference method is not documented so I just would like to be sure that it’s ok to use this way and that it has no drawback?

Thanks.

May 22, 2017
13:48, EEST
Avatar
Bjarne Boström
Moderator
Moderators
Forum Posts: 1032
Member Since:
April 3, 2012
sp_UserOfflineSmall Offline

Hi,

Yes you are correct, it behaves as you expect. Seems we are missing javadocs there.. in fact the only mention is in the 2.0.0 release notes which stated “New: ServerNode.addNewReference() – fast implementation without checks “.

As long as you are sure the reference does not exist in the node already, there should be no drawbacks.

– Bjarne

(As a note for future readers, the method is in ServerNode, i.e.server side implementations of UaNode and not directly in UaNode interface)

Forum Timezone: Europe/Helsinki

Most Users Ever Online: 1919

Currently Online:
22 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Heikki Tahvanainen: 402

hbrackel: 144

rocket science: 88

pramanj: 86

Francesco Zambon: 83

Ibrahim: 78

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

Member Stats:

Guest Posters: 0

Members: 729

Moderators: 7

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1529

Posts: 6471

Newest Members:

toneylapham544, rondawolinski7, Marypof5711, roycedelargie91, kourtneyquisenbe, ellis87832073466, zkxwilliemae, gabriellabachus, Deakin, KTP25Zof

Moderators: Jouni Aro: 1026, Pyry: 1, Petri: 0, Bjarne Boström: 1032, Jimmy Ni: 26, Matti Siponen: 349, Lusetti: 0

Administrators: admin: 1