Paul.Withers Posted August 23, 2019 Share Posted August 23, 2019 Hi, I'm trying to create thousands of WidgetLabels using WidgetLabel::create() and it's taking a very long time (15-20 seconds on my high end pc). Is there a faster way to create them instead of one function call per new object? Cheers! Link to comment
morbid Posted August 23, 2019 Share Posted August 23, 2019 Hello Paul, We checked the speed with our stress sample (<sdk>\data\samples\stress) and all widget were created really fast. 10 000 were created in less than 1 second on intel core i5 6600. Could you please send us a code sample where we can analyze the issue? Thank you. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Paul.Withers Posted August 23, 2019 Author Share Posted August 23, 2019 Thanks for the fast reply! It's just a simple loop that creates WidgetLabels, but it's creating over 300, 000 :) How does it compare to Unigine::ObjectGui::create()? I can call that function the same number of times and the creation time is nearly instant. Link to comment
silent Posted August 23, 2019 Share Posted August 23, 2019 Hi Paul, For 300k widgets, I'm afraid there is nothing we can do :) Btw, why do you need 300k independent labels? It probably will give you 1fps in real project. And the difference between adding 300k Widgets and 300k empty ObjectGUI is that ObjectGUI performs simple for loop and checks inside: <...> for (int i = 0; i < children.size(); i++) { if (children[i] == widget) <..> For 300k widgets we perform ((1 + 300000) / 2) * 300000 = 45000150000 comparisons (45 billions). I would say that thousands / tens of thousands widgets is the upper limit for adequate performance. Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
silent Posted August 23, 2019 Share Posted August 23, 2019 In theory splitting your 300k WidgetLables between multiple WidgetVBox/WidgetHBox (let's say 1000) should improve the creation speed. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Paul.Withers Posted August 26, 2019 Author Share Posted August 26, 2019 My mistake, i didn't mean WidgetLabel, the bottleneck is Unigine::ObjectGui::create(), which is showing up in my profiler as being about 1.5 milliseconds per call. Can i confirm this performance, and is there a more optimal way of creating ObjectGui's? Link to comment
silent Posted August 26, 2019 Share Posted August 26, 2019 Hi Paul, I'm afraid there is nothing else what we can suggest to improve this, sorry. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts