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: 983
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: 518

Currently Online:
20 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

hbrackel: 135

pramanj: 86

Francesco Zambon: 81

rocket science: 77

Ibrahim: 76

Sabari: 62

kapsl: 57

gjevremovic: 49

Xavier: 43

TimK: 41

Member Stats:

Guest Posters: 0

Members: 682

Moderators: 16

Admins: 1

Forum Stats:

Groups: 3

Forums: 15

Topics: 1467

Posts: 6261

Newest Members:

karrimacvitie5, graciela2073, sagarchau, elviralangwell4, Donnavek, Eddiefauth, DonaldPooma, fidelduke938316, Jan-Pfizer, DavidROunc

Moderators: Jouni Aro: 1010, Otso Palonen: 32, Tuomas Hiltunen: 5, Pyry: 1, Petri: 0, Bjarne Boström: 983, Heikki Tahvanainen: 402, Jukka Asikainen: 1, moldzh08: 0, Jimmy Ni: 26, Teppo Uimonen: 21, Markus Johansson: 42, Niklas Nurminen: 0, Matti Siponen: 321, Lusetti: 0, Ari-Pekka Soikkeli: 5

Administrators: admin: 1