Getting selector from UiElement is slow

Hello

I have to iterate over about 2k elements and get the elemewnts selector. How ever, I find it very slow to read the selector from the element. It takes between 700-1300ms for each elements.

Code below shows how I measure the timespan for each element. And it is now important for my question as such. =)

            foreach (UiElement e in rtList)
            {
                sw = new Stopwatch();
                sw.Start();
                sb.Append( e.Selector.ToString() + "\n");
                sw.Stop();
                Log("Elaps: " + sw.ElapsedMilliseconds.ToString());
            }

Is this normal or is there a better way to extract the selector for each element?

Best regards
Rickard

1 Like

I found what I needed in the elements attributes array - which is super quick. Still strange that getting the selector is so slow.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.