Practical limits on object counts

Phil Davis revdev at pdslabs.net
Sat Oct 3 17:32:41 EDT 2009


OK, I lied - I made time to test. I just did this:

on mouseUp
   lock screen
   lock messages
  
   create group "test"
   repeat with x = 1 to 12000
      create btn ("test_" & x) in grp "test"
      if x mod 100 = 0 then put x
   end repeat
   remove grp "test" from this cd
  
   unlock messages
   unlock screen
   beep
end mouseUp


Then I did this in msg:

put the id of button 4444 of bg "test"

... which returned this:
11212

So you CAN access those objects.

Phil




Phil Davis wrote:
> Hi Richard,
>
> No time to experiment right now, but I wonder how things would work if 
> you grouped the objects and removed the group (bg) from the card, 
> letting it float in the netherworld of unplaced backgrounds within the 
> stack. Naaahh... I guess you would have to place the group before you 
> would have access to its objects, right? Or maybe not.
>
> Just thinking out loud.
>
> Phil
>
>
> Richard Gaskin wrote:
>> Paul Foraker wrote:
>>
>> > On Fri, Oct 2, 2009 at 5:44 PM, Richard Gaskin
>> > <ambassador at fourthworld.com> wrote:
>> >> Have any of you worked on stacks with an insane number of objects
>> >> on a card (>5,000)?
>> >>
>> >> What issues did you encounter?
>> >
>> > I have a bead pattern generator that dynamically clones a small
>> > graphic to produce 4,634 of them arranged according to dimensions and
>> > patterns set by the user. There are also some fields and buttons,
>> > bringing the total number of controls to 4,646. It takes about 2
>> > seconds to render on an iMac with the screen locked. When you mouse
>> > down on the inspection arrow in the Property Inspector, you get a
>> > disabled item: "Too many controls to display [4646]". There aren't too
>> > many fields or buttons to display, but it doesn't care. :)
>>
>> Maybe it meant "Too many for the IDE to display", since it seems the 
>> engine is fine. :)
>>
>> I wonder exactly what their threshold is for "too many", and how they 
>> arrived at it when they wrote their IDE.
>>
>> The more I played around with my tests, the more I see a very 
>> dramatic difference in responsiveness beyond a certain threshold 
>> somewhere beyond 6,000 objects.  I haven't yet pinned it down 
>> exactly, but definitely 10,000 is beyond acceptable for most uses, so 
>> it's somewhere between 6k and 9k.
>>
>> The difference between 6k and 9k objects is so dramatic that I have 
>> to wonder if there's some aspect of how the engine's memory mapping 
>> or object hashes were written that may play a role in the sharp 
>> performance degradation.
>>
>> I dunno.  I just know not to try working with 9k objects. ;)
>>
>> -- 
>

-- 
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net




More information about the use-livecode mailing list