Complex object creation is time consuming

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

Moderator: uasdkcpp

Post Reply
SanthoshEP
Jr. Member
Jr. Member
Posts: 1
Joined: 22 Aug 2019, 09:57

Complex object creation is time consuming

Post by SanthoshEP »

Hi Support Team,

I'm using Unified Automation UA SDK C++ Bundle PubSub 1.7.0 Eval version.

I have created a complex object using Modeler which is having the following class hierarchy :

BaseObjectType->BaseEventType->ConditionTypeBase->ConditionType->AcknowledgeableConditionTypeBase->AcknowledgeableConditionType->AlarmConditionTypeBase->AlarmConditionType->MyAlarm

I was trying to create 20,000 MyAlarm objects in single thread. But time to create alarms keep varying. Please find the below statistics.

5000 Alarms - 23secs
10000 Alarms - 1min 16secs
15000 Alarms - 2min 42secs
20000 Alarms - 4min 34secs

Please find my questions regarding the above scenario.

1. Is Multithreading supported in creation of objects. [Because I have already tried that, but even after using multithreading same statistics has been observed]
2. Normally if 23secs was taken to create 5000 objects, it should take almost same (or almost nearer time say 25-30secs) to create the next 5000 objects also. But instead it was taking more than a minute to create next 5000 objects and keep increasing. Could you please throw some light on what could be going wrong.

This can be easily reproducible at your end by following the below steps.
1. Open the sample application under C:\Program Files (x86)\UnifiedAutomation\UaSdkCppBundlePubSubEval\examples\server_gettingstarted\lesson03\server_lesson03.sln
2. Open C:\Program Files (x86)\UnifiedAutomation\UaSdkCppBundlePubSubEval\examples\simulation_buildingautomation\bacommunicationinterface.cpp
3. Modify the macro value like below
#define NUMBER_AIRCONDITIONER 10000
#define NUMBER_FURNACES 10000
4. Run the sample application.
5. In this example AirConditionerControllerObject & FurnaceControllerObject are not much complex objects. But still it takes more than 2min to create 20,000 objects

Please let me know your thoughts on what could be going wrong and your suggestions on how to improve the performance.

Thank you

Post Reply