On Wed, 15 May 2002 16:47:00 -0400 Brian Keefer mgomes21@cox.net wrote:
By brutally slow, I mean flushDependents takes over a minute. My image gradually came to this level of sloth, I only noticed the growing delay in save&|quit(which do explicit GC with flushDependents). DependentsFields contains 4600 instances of ClassInHierarchyWrapper, which I guess is eating most of my cycles. According to Object's comment, heavy users of dependents should inherit from Model, and carry their own deps list. Would reparenting ListItemWrapper to Modal be the right fix?
Brian,
I did a little test and was about to inquire just how slow your computer was when I re-read your message. My test had added 4600 items to DependentsFields and then timed Object flushDependents -- about 6 seconds. When I saw you actually had more than 4600 items total, I counted up what was in your jpeg and tried again with 7532 items in DependentsFields. This time it took 61 seconds! Looks like you have crossed a threshhold where the 12-bit identity hash values stop being reasonably efficient and result in lots of re-probing.
So, yes, try reparenting the wrappers from Model or just implement #myDependents and #myDependents: so as to avoid inheriting anything you don't need (there may be some isKindOf: Model tests out there somewhere).
Cheers, Bob
On Wed, 15 May 2002, Bob Arning wrote:
On Wed, 15 May 2002 16:47:00 -0400 Brian Keefer mgomes21@cox.net wrote:
By brutally slow, I mean flushDependents takes over a minute. My image gradually came to this level of sloth, I only noticed the growing delay in save&|quit(which do explicit GC with flushDependents). DependentsFields contains 4600 instances of ClassInHierarchyWrapper, which I guess is eating most of my cycles. According to Object's comment, heavy users of dependents should inherit from Model, and carry their own deps list. Would reparenting ListItemWrapper to Modal be the right fix?
counted up what was in your jpeg and tried again with 7532 items in DependentsFields. This time it took 61 seconds! Looks like you have crossed a threshhold where the 12-bit identity hash values stop being reasonably efficient and result in lots of re-probing.
They don't have to be that way... My IdentityHash changeset (early february) reduces this problem by about 500x.... Right now, for Dictionaries >4000 elements, that do *not* define a custom hash functions, we're no faster than a full linear scan.
Another temporary *HACK*, roughly equivalent in effect to that changeset is to add:
YourClass>>hash self identityHash * 2000
to whatever the dependent class is.
Sorry for not keeping up with everything going on here.
Scott
squeak-dev@lists.squeakfoundation.org