Dynamic Protocols in the Dev-images
Zulq Alam
me at zulq.net
Wed Jan 30 16:59:19 UTC 2008
Hi Damien,
I like the dynamic protocols but don't use them because of the
performance impact.
I was curious and profiled it. It looks like the local send cache is not
being used as no interests are being declared.
In the code below I declare interest in everything. I'm not sure about
the ramifications of this.
When cached it is almost usable - perhaps with some tweaking this
excellent feature could be more widely used.
Regards,
Zulq.
protocols := DynamicProtocols allAvailableProtocols.
class := Object.
" clear caches "
protocols asArray collect: [:dp | dp invalidateCache].
LocalSends current initialize.
TimeProfileBrowser spyOn: [protocols
collect: [:dpClass | dpClass on: aClass]
thenSelect: [:dp | (dp getSelectorsFor: Object) notEmpty]].
" 9.69 seconds "
TimeProfileBrowser spyOn: [protocols
collect: [:dpClass | dpClass on: aClass]
thenSelect: [:dp | (dp getSelectorsFor: Object) notEmpty]].
" 6.44 seconds - improvement from caches in dynamic protocols themselves"
" declare interest in everything (maybe wrong) "
LocalSends current
noteInterestOf: nil in: ProtoObject;
noteInterestOf: nil inAll: ProtoObject allSubclasses.
" prime local send caches "
TimeProfileBrowser spyOn: [protocols
collect: [:dpClass | dpClass on: aClass]
thenSelect: [:dp | (dp getSelectorsFor: Object) notEmpty]].
"6.49 seconds "
" local sends cached "
TimeProfileBrowser spyOn: [protocols
collect: [:dpClass | dpClass on: aClass]
thenSelect: [:dp | (dp getSelectorsFor: Object) notEmpty]].
"0.69 seconds "
Damien Cassou wrote:
> Hi,
>
> as the developer of both the Dynamic Protocols and the dev-images, I
> have included the firsts into the latter some times ago. I found them
> quite useful at that time. However, they slow down a lot the UI (which
> is already very slow). So, my question is:
>
> Who wants me to continue including the dynamic protocols in the dev-images?
>
>
> Is there anyone using them?
>
> Bye
>
More information about the Squeak-dev
mailing list
|