Dynamic Protocols in the Dev-images

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
29 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Protocols in the Dev-images

Damien Cassou-3
Hi Zulq,

I don't have time to invest in this project. However, the repository
is open. Feel free to commit anything you think appropriate. If you
made any progress, let me know. Ask me any question you might have on
the code, I'll be very happy to answer. I think that is it quite
simple and there is not much code (most of the computation is done by
another project which I didn't write).

Thank you

On Jan 30, 2008 5:59 PM, Zulq Alam <[hidden email]> wrote:

> 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
> >
>
>
>



--
Damien Cassou

Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Protocols in the Dev-images

Damien Cassou-3
In reply to this post by Jason Johnson-5
On Jan 30, 2008 5:54 PM, Jason Johnson <[hidden email]> wrote:
> On Jan 30, 2008 4:03 PM, Damien Cassou <[hidden email]> wrote:
> >
> > > Does the "traits" button is
> > > System Browser comes from DynamicProtocols?
> >
> > Not at all.
>
> Dumb question:  What *are* they used for in the dev image when turned on?

Dynamic Protocols computes method categories automatically. For
example, you have a category for the long method (more than 10 lines),
a category for debugging methods (with a self halt), a category for
required methods (sent but not implemented)... If there is no method
in a category, it is not displayed.


--
Damien Cassou

Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Protocols in the Dev-images

Daniel Vainsencher-3
In reply to this post by Sophie424
Thanks you. It is a pattern paper, so that any existing examples would
be welcome, and if you use them, any further experience is also of interest.


Daniel


itsme213 wrote:

> "Daniel Vainsencher" <[hidden email]> wrote
>
>  
>> [1]  http://web.cecs.pdx.edu/~black/publications/ModelExtensions.pdf
>>    
>
> Very nice paper, thank you.
>
> Sophie
>
>
>
>
>  



Reply | Threaded
Open this post in threaded view
|

Re: Model Extensions

Daniel Vainsencher-3
In reply to this post by Tapple Gao
Your changes sound like valuable infrastructure, not only for model
extensions. To help them get included, I suggest you introduce them in
small, well explained pieces. Note that classes are rather tricky
objects, and class changes are tricky operations. Be careful... have tests.


Daniel


Matthew Fulmer wrote:

>> [1]  http://web.cecs.pdx.edu/~black/publications/ModelExtensions.pdf
>>    
>
> On page 22 of this paper, you mentioned that the notification
> mechanism should tell you the previous values of classes and
> methods for the purpose of cache invalidation.
>
> Goran and I made just these changes to SystemChangeNotifier in
> Squeak as part of our DeltaStreams project; now, when classes,
> methods, and class comments are changed, a notification with both
> the old and new version is sent. It is completely
> backward-compatible with the old SystemChangeNotifier protocol,
> as far as we can tell:
>
> http://map.squeak.org/packagebyname/deltastreamfixes
>
> In the future (a month or two), I'm going to augment the
> notifier again to support grouping of related changes, such as
> all changes involved in loading a package, filing-in a
> changeset, or loading a bug-fix, so that the enhanced logging
> features of DeltaStreams can show system changes at more the
> level the user made them; loading a package was a single-action
> to them; the log should show it as a single action.
>
>  


Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Protocols in the Dev-images

stephane ducasse
In reply to this post by Ramon Leon-5
I agree. The popup is also a bt annoying in the long term.
I also got the impression that at each doit I did the protocols got  
recomputed....arghh

Stef

On Jan 30, 2008, at 4:28 PM, Ramon Leon wrote:

>>> Keep DynamicProtocols preinstalled in dev-image and set preference
>>> option to false by default (dynamicProtocolActivation).
>>
>> This was my idea too.
>> --
>> Damien Cassou
>
> I'd think the things pre-installed are the ones that mostly everyone  
> uses,
> like Shout and OmniBrowser. You long ago moved optional packages to  
> the
> Universe, why would DynamicProtocols be any different?
>
> Ramon Leon
> http://onsmalltalk.com
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Protocols in the Dev-images

stephane ducasse
In reply to this post by timrowledge
I got the same feeling with
mac os x and mac os 9
and my old linux box.

but seriously this is true that we may have lost profiling habits and  
getting a snappier UI would help.
Now for 3.9 I would like to remind you that some of the fonts are not  
cached because we did not integrate
a fix because for that we should have publish a change on a graphics  
package that was not maintained by us.

stef



>>> Dumb question:  What *are* they used for in the dev image
>>> when turned on?
>>
>> Real answer, from memory, dynamically computed method protocols,  
>> just look
>> at the list of categories in your preferences under dynamic  
>> protocols.
>> Interesting idea, but Squeak's UI is slow enough as it is, it  
>> doesn't have
>> extra cycles to spare.
> Which is, if you think about it, a quite ridiculous state of  
> affairs. Ten years ago with machines that struggled to achieve  
> tinyBenchmark figures of 3 million bc/sec we were able to use the UI  
> tolerably. My current machine manages 544 million bc/sec  - 180  
> times as fast - and yet the UI is if anything slower and less  
> usable. And this is in a plain 3.9 image without the cpu-sucking  
> dynamic protocols!
>
> Insane.
>
> tim
> --
> tim Rowledge; [hidden email]; http://www.rowledge.org/tim
> "Bother," said Pooh, reading his bank statement from Barings.
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Model Extensions

stephane ducasse
In reply to this post by Tapple Gao
I'm and roel too will be certainly happy to see that his  
changenotifier get used, adpated and extended.
This is because we have a better infrastructure that we will get  
better tools in a easier manner.

The changeNotifier was one piece of this puzzle.

Stef

On Jan 31, 2008, at 2:57 AM, Matthew Fulmer wrote:

>> [1]  http://web.cecs.pdx.edu/~black/publications/ModelExtensions.pdf
>
> On page 22 of this paper, you mentioned that the notification
> mechanism should tell you the previous values of classes and
> methods for the purpose of cache invalidation.
>
> Goran and I made just these changes to SystemChangeNotifier in
> Squeak as part of our DeltaStreams project; now, when classes,
> methods, and class comments are changed, a notification with both
> the old and new version is sent. It is completely
> backward-compatible with the old SystemChangeNotifier protocol,
> as far as we can tell:
>
> http://map.squeak.org/packagebyname/deltastreamfixes
>
> In the future (a month or two), I'm going to augment the
> notifier again to support grouping of related changes, such as
> all changes involved in loading a package, filing-in a
> changeset, or loading a bug-fix, so that the enhanced logging
> features of DeltaStreams can show system changes at more the
> level the user made them; loading a package was a single-action
> to them; the log should show it as a single action.
>
> --
> Matthew Fulmer -- http://mtfulmer.wordpress.com/
> Help improve Squeak Documentation: http://wiki.squeak.org/squeak/808
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Protocols in the Dev-images

Zulq Alam-2
In reply to this post by stephane ducasse

stephane ducasse wrote:

>
> I also got the impression that at each doit I did the protocols got
> recomputed....arghh
>
>

You are correct. Each instance of OBCodeBrowser is registered to be
notified of all system changes. Notification triggers regeneration of
dynamic protocols.

A "do it" or "print it" is evaluated using
Compiler>>#evaluate:in:to:notifying:ifFail:logged: which triggers this
notification.

Confusingly, when you "debug it", this notification isn't sent. The code
is compiled and executed but no notification is sent.

But, if you debug something that does change the system like: "Object
compile: 'dude ^ ''sweet'''" then a notification is triggered.

I conclude that either "debug it" isn't correctly notifying or "do
it"/"print it" are sending out unnecessary notifications.

With regard to dynamic protocols, none of this should matter if it were
fast enough although it would help to reduce the number of times they
are regenerated.

Regards,
Zulq.


Reply | Threaded
Open this post in threaded view
|

Re: Dynamic Protocols in the Dev-images

stephane ducasse
Nice catch.
May be add a bug report because it would be that tool builders can  
rely on good information notification.

Stef

On Feb 3, 2008, at 4:07 PM, Zulq Alam wrote:

>
> stephane ducasse wrote:
>
>> I also got the impression that at each doit I did the protocols got  
>> recomputed....arghh
>
> You are correct. Each instance of OBCodeBrowser is registered to be  
> notified of all system changes. Notification triggers regeneration  
> of dynamic protocols.
>
> A "do it" or "print it" is evaluated using  
> Compiler>>#evaluate:in:to:notifying:ifFail:logged: which triggers  
> this notification.
>
> Confusingly, when you "debug it", this notification isn't sent. The  
> code is compiled and executed but no notification is sent.
>
> But, if you debug something that does change the system like:  
> "Object compile: 'dude ^ ''sweet'''" then a notification is triggered.
>
> I conclude that either "debug it" isn't correctly notifying or "do  
> it"/"print it" are sending out unnecessary notifications.
>
> With regard to dynamic protocols, none of this should matter if it  
> were fast enough although it would help to reduce the number of  
> times they are regenerated.
>
> Regards,
> Zulq.
>
>
>


12