Re: [Pharo-users] Finding all references to an object
On Aug 3, 2011, at 8:45 AM, Pat Maddox wrote:
On Aug 2, 2011, at 11:40 PM, Sean P. DeNigris wrote:
Pat Maddox-3 wrote:
become: swaps the two objects entirely, becomeForward: "replaces" references with the argument.
Got it, thanks. The system tests (duh) for these are really clear.
it's generally better to use becomeForward: unless you have a really good reason to use become: and it's generally better to use anything other than becomeForward: if you can. It's what dubya would call "the nukular opshin"
And you need to take care: #become can be very slow. It can (if not both objects are in the newspace of the GC) require to scan the *whole* memory. This is slow and performance degrades the more memory you use. The "fast bulk become" that is sometimes listed as a major innovation of the squeak vm is only related to becomming multiple objects: you can become a group of objects and traverse the memory only once. But as it does scan the whole memory. The sad thing is that a fast become would be really nice for many things... e.g. if you want to do highly dynamic stuff with proxies. Making objects remote, swap them, or have proxies for objects-not-yet there (futures)... But in practice #become is far too slow for these. We should change that. Marcus -- Marcus Denker -- http://marcusdenker.de
Marcus Denker-4 wrote:
you need to take care: #become can be very slow.
Thanks for pointing that out. I'm finding a need for it, not in production, but as I eat my own dog food playing with my evolving systems, so speed is not an issue. Sean -- View this message in context: http://forum.world.st/Finding-all-references-to-an-object-tp3714218p3715339.... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
participants (2)
-
Marcus Denker -
Sean P. DeNigris