[squeak-dev] iterating on compiled methods

Nicolas Cellier nicolas.cellier.aka.nice at gmail.com
Sat Jan 16 09:54:50 UTC 2010


2010/1/16 Eliot Miranda <eliot.miranda at gmail.com>:
>
>
> On Fri, Jan 15, 2010 at 1:08 PM, Nicolas Cellier
> <nicolas.cellier.aka.nice at gmail.com> wrote:
>>
>> I noticed the first pattern is often used: we iterate on selectors
>> when we want to iterate on CompiledMethods
>> methodDictionary do: is maybe not a nice pattern, wa can replace with
>> compiledMethodsDo: or just methodsDo:
>> I think such change could be noticeable in development tools on slow
>> machines
>>
>
> I think the right way to iterate over a class's methods is
> aClass selectorsAndMethodsDo: [:sel :meth| ... ]
>

Good, that's just what I did.

>>
>> {
>> [Morph selectorsDo: [:sel | | m | m := Morph compiledMethodAt: sel]]
>> bench.
>> [Morph methodDictionary do: [:m | ]] bench.
>> }
>> #('683.0633873225355 per second.' '4275.94481103779 per second.')
>>
>> Nicolas
>>
>
>
>
>
>



More information about the Squeak-dev mailing list