

12:26, EEST
March 26, 2014

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.
13:48, EEST

April 3, 2012

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)
Most Users Ever Online: 1919
Currently Online:
33 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: 800
Moderators: 7
Admins: 1
Forum Stats:
Groups: 3
Forums: 15
Topics: 1539
Posts: 6496
Newest Members:
jerrywarkentin7, rebekahfortner3, Stevennox, qfpalfie08, brittny89u, LinwoodBup, isabellabeeton2, ladonnacdv, DarwinVew, betseymitford95Moderators: Jouni Aro: 1028, Pyry: 1, Petri: 0, Bjarne Boström: 1037, Jimmy Ni: 26, Matti Siponen: 353, Lusetti: 0
Administrators: admin: 1