Slow when inspecting dozens of objects

Support forum for our custom runtime inspector controls.

Slow when inspecting dozens of objects

Postby amarryat » Mon Oct 20, 2014 2:05 pm

Is there a strategy to speed up the object inspector's processing when inspecting a hundred objects for example?

I have an objects editor, where a user may want to select 100 objects on the screen and change their color for instance. Once there are more than 20 or so objects selected, the inspector lags, and the more there are, the longer it takes. It could take a few seconds if there are 100 objects selected.

This happens after code like this (SH is a control that has a bunch of objects on it), and Self is the object inspector being used via a class helper:

for i := 0 to SH.ChildCount-1 do
if SH.Children[i] is THMI then
Self.Objects.Add.Component := SH.Children[i];

The code above processes instantly, but after that the screen has to redraw, and I believe this is where the pause occurs.
amarryat
 
Posts: 5
Joined:
Thu May 22, 2014 8:35 am

Re: Slow when inspecting dozens of objects

Postby Inspex » Mon Oct 20, 2014 2:29 pm

Hi,
When you are adding lots of objects to the inspector, you need to wrap it in BeginUpdate/EndUpdate calls:
Self.Objects. BeginUpdate;
Try
for i := 0 to SH.ChildCount-1 do
if SH.Children[i] is THMI then
Self.Objects.Add.Component := SH.Children[i];
Finally
Self.Objects. EndUpdate;
Regards,
Tom
---------
Tom Grubb - Inspex Support
Inspex@raize.com
Inspex
 
Posts: 5
Joined:
Fri Apr 15, 2011 6:37 am

Re: Slow when inspecting dozens of objects

Postby amarryat » Mon Oct 20, 2014 2:36 pm

Inspex wrote:Hi,
When you are adding lots of objects to the inspector, you need to wrap it in BeginUpdate/EndUpdate calls:
Self.Objects. BeginUpdate;
Try
for i := 0 to SH.ChildCount-1 do
if SH.Children[i] is THMI then
Self.Objects.Add.Component := SH.Children[i];
Finally
Self.Objects. EndUpdate;
Regards,
Tom



Thank you! That did the trick. Not sure why I didn't have that in there since that's exactly what I was doing when adding filters and categories.
amarryat
 
Posts: 5
Joined:
Thu May 22, 2014 8:35 am


Return to Inspex

Who is online

Users browsing this forum: No registered users and 0 guests

cron