Jump to content

Creating Widets performance problems


photo

Recommended Posts

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

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:

Link to comment

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

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:

Link to comment

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
×
×
  • Create New...