Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-09-01 Thread stepharo
this is really cool :) Le 1/9/16 à 10:21, Thierry Goubier a écrit : Hi Stef, here is the script I use: | c1 c2 c3 n1 n2 n3 l1 l2 l3 | c1 := c2 := c3 := 0. n1 := (Announcer>>#announce:) ast. n2 := #(subscribe:do: subscribe:send:to: basicSubscribe:) collect: [ :e | (Announcer>>e) ast ]. n3 :=

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-09-01 Thread Thierry Goubier
2016-09-01 10:29 GMT+02:00 Denis Kudriashov : > Hi Thierry. > > 2016-09-01 10:21 GMT+02:00 Thierry Goubier : > >> (Duration minutes: 1) wait. >> > > Just to mention our nice language: it could be written as: > > > 1 minutes wait > > > Thanks. Didn't find that one when searching through the code.

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-09-01 Thread Sven Van Caekenberghe
> On 01 Sep 2016, at 10:21, Thierry Goubier wrote: > > Hi Stef, > > here is the script I use: > > | c1 c2 c3 n1 n2 n3 l1 l2 l3 | > c1 := c2 := c3 := 0. > n1 := (Announcer>>#announce:) ast. > n2 := #(subscribe:do: subscribe:send:to: basicSubscribe:) collect: [ :e | > (Announcer>>e) ast ]. > n3

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-09-01 Thread Denis Kudriashov
Hi Thierry. 2016-09-01 10:21 GMT+02:00 Thierry Goubier : > (Duration minutes: 1) wait. > Just to mention our nice language: it could be written as: 1 minutes wait

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-09-01 Thread Thierry Goubier
Hi Stef, here is the script I use: | c1 c2 c3 n1 n2 n3 l1 l2 l3 | c1 := c2 := c3 := 0. n1 := (Announcer>>#announce:) ast. n2 := #(subscribe:do: subscribe:send:to: basicSubscribe:) collect: [ :e | (Announcer>>e) ast ]. n3 := #(unsubscribe: removeSubscription:) collect: [ :e | (Announcer>>e) ast ].

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-09-01 Thread Denis Kudriashov
2016-09-01 9:57 GMT+02:00 Denis Kudriashov : > Really? You lost me on that sentence. SystemAnnouncer current is shared by >> all the tools no? > > > Yes, you are right. I forgot this big monster :). > Now I look at senders of #announcer and there are many places with chain > like "aSomebody announ

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-09-01 Thread Denis Kudriashov
2016-09-01 8:18 GMT+02:00 stepharo : > > But in practice we never share any announcer instance. > > Really? You lost me on that sentence. SystemAnnouncer current is shared by > all the tools no? Yes, you are right. I forgot this big monster :). Now I look at senders of #announcer and there are m

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-09-01 Thread Thierry Goubier
Hi Stef, 2016-09-01 8:13 GMT+02:00 stepharo : > Hi thierry > > I think that if we would have a tool to show us the activity I'm quite > sure that we would find bugs > > or mistaken behavior. > Yes. I did some checks on Morphic and AltBrowser after getting the numbers, to see if I wasn't doing s

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-31 Thread stepharo
Le 31/8/16 à 11:23, Denis Kudriashov a écrit : 2016-08-31 10:10 GMT+02:00 Glenn Cavarlé >: Hi all (I was out for some days), Hi Glenn What i see is that Bloc EventRegistry: 1) is not thread safe (no mutex + #select:thenDo:) 2) doesn't allow

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-31 Thread stepharo
To me, Announcer is really usefull and efficient when it is used as an event bus that can be shared between multiple objects. For instance, it seems to be useless to use an Announcer in NewValueHolder because it cannot be shared and it is only used internally to register handlers and to propagat

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-31 Thread stepharo
Hi thierry I think that if we would have a tool to show us the activity I'm quite sure that we would find bugs or mistaken behavior. could you send the scripts you did? Stef Le 30/8/16 à 22:36, Thierry Goubier a écrit : Numbers for the discussion: No activity, empty desktop: announcement

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-31 Thread Thierry Goubier
2016-08-31 18:01 GMT+02:00 Henrik Johansen : > > On 31 Aug 2016, at 10:10 , Glenn Cavarlé wrote: > > In Bloc the constraint is to propagate more than 2000 events/second without > to decrease fps > > > That's only a small part of the picture though, how many listeners are > there per each event? >

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-31 Thread Henrik Johansen
On 31 Aug 2016, at 10:10 , Glenn Cavarlé wrote:In Bloc the constraint is to propagate more than 2000 events/second withoutto decrease fpsThat's only a small part of the picture though, how many listeners are there per each event?And how large do you think the overhead spec

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-31 Thread Glenn Cavarlé
Hi Denis, > Problem that concurrent modification of OrderedCollection could just fail. > You will got debugger. Yes, effectively, if there are multiple threads that try to add an handler on the same element at the same time, this could just fail. To me, it is not a problem, it is just a rule: the

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-31 Thread Denis Kudriashov
2016-08-31 10:10 GMT+02:00 Glenn Cavarlé : > Hi all (I was out for some days), > Hi Glenn > > What i see is that Bloc EventRegistry: > 1) is not thread safe (no mutex + #select:thenDo:) > 2) doesn't allow handler removal from the handler list currently used in > the > thenDo: loop > 3) is used

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-31 Thread Glenn Cavarlé
Hi all (I was out for some days), What i see is that Bloc EventRegistry: 1) is not thread safe (no mutex + #select:thenDo:) 2) doesn't allow handler removal from the handler list currently used in the thenDo: loop 3) is used specifically for a one-to-many communication (1 BlElement -> X handlers)

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Thierry Goubier
Numbers for the discussion: No activity, empty desktop: announcements 608/minute subscribe add/remove9/minute Activity, AltBrowser: announcements 1109/minute subscribe add/remove207/minute Activity, Nautilus: announcements

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Thierry Goubier
2016-08-30 17:36 GMT+02:00 Henrik Johansen : > > > On 30 Aug 2016, at 5:16 , Thierry Goubier > wrote: > > > > > > I have the same concern with an Announcer optimized for certain use > cases, in the fact that the announcer creator is the one choosing the 'kind > of' optimisation it would target, h

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Henrik Johansen
> On 30 Aug 2016, at 5:16 , Thierry Goubier wrote: > > > I have the same concern with an Announcer optimized for certain use cases, in > the fact that the announcer creator is the one choosing the 'kind of' > optimisation it would target, hoping that the listeners will conform to that > use

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Thierry Goubier
2016-08-30 16:01 GMT+02:00 Henrik Johansen : > > On 29 Aug 2016, at 6:39 , Denis Kudriashov wrote: > > And now question is why SubscriptionRegistry manages subscriptions as > IdentitySet instead of OrderedCollection? > > > 1) Performance of remove operation is the main reason. Sure, registration

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Henrik Johansen
> On 29 Aug 2016, at 6:39 , Denis Kudriashov wrote: > > And now question is why SubscriptionRegistry manages subscriptions as > IdentitySet instead of OrderedCollection? 1) Performance of remove operation is the main reason. Sure, registration has a larger constant overhead than using an Orde

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Thierry Goubier
2016-08-30 11:12 GMT+02:00 Denis Kudriashov : > > 2016-08-30 10:35 GMT+02:00 Thierry Goubier : > >> >> 2016-08-30 10:28 GMT+02:00 Denis Kudriashov : >> >>> >>> 2016-08-30 10:21 GMT+02:00 Guille Polito : >>> Hi, From the top of my head: I would understand that systems where there >>>

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Denis Kudriashov
2016-08-30 10:35 GMT+02:00 Thierry Goubier : > > 2016-08-30 10:28 GMT+02:00 Denis Kudriashov : > >> >> 2016-08-30 10:21 GMT+02:00 Guille Polito : >> >>> Hi, >>> >>> From the top of my head: I would understand that systems where there are >>> hundreds of thousands of events per second, maybe one do

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Thierry Goubier
2016-08-30 10:41 GMT+02:00 Norbert Hartl : > > Am 30.08.2016 um 09:44 schrieb Denis Kudriashov : > > Hi > > 2016-08-30 8:52 GMT+02:00 Norbert Hartl : > >> I think for the 0 case we should think about instantiating the >> SubscriptionRegistry lazily. This would also mitigate the effect that if a >>

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Guille Polito
One Morph <> One Announcer sounds bad in terms of memory consumption, yes. Maybe it makes more sense something like One Widged <> One Announcer But the problem is that today the line between Morphs and Widgets is not clearly set. I hope Bloc/Bric helps on this. Original Me

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Norbert Hartl
> Am 30.08.2016 um 09:44 schrieb Denis Kudriashov : > > Hi > > 2016-08-30 8:52 GMT+02:00 Norbert Hartl >: > I think for the 0 case we should think about instantiating the > SubscriptionRegistry lazily. This would also mitigate the effect that if a > lot of announcer

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Thierry Goubier
2016-08-30 10:28 GMT+02:00 Denis Kudriashov : > > 2016-08-30 10:21 GMT+02:00 Guille Polito : > >> Hi, >> >> From the top of my head: I would understand that systems where there are >> hundreds of thousands of events per second, maybe one does not want to pay >> the overhead of announcements... >>

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Denis Kudriashov
2016-08-30 10:21 GMT+02:00 Guille Polito : > Hi, > > From the top of my head: I would understand that systems where there are > hundreds of thousands of events per second, maybe one does not want to pay > the overhead of announcements... > > But, How many events are produced from a morph per secon

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Guille Polito
Hi, From the top of my head: I would understand that systems where there are hundreds of thousands of events per second, maybe one does not want to pay the overhead of announcements... But, How many events are produced from a morph per second? One? Two? Five? Is it really the case of morphs

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Thierry Goubier
2016-08-30 9:44 GMT+02:00 Denis Kudriashov : > Hi > > 2016-08-30 8:52 GMT+02:00 Norbert Hartl : > >> I think for the 0 case we should think about instantiating the >> SubscriptionRegistry lazily. This would also mitigate the effect that if a >> lot of announcers are created they create only a sing

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Denis Kudriashov
2016-08-30 9:44 GMT+02:00 Denis Kudriashov : > > 2016-08-30 8:52 GMT+02:00 Norbert Hartl : > >> I think for the 0 case we should think about instantiating the >> SubscriptionRegistry lazily. This would also mitigate the effect that if a >> lot of announcers are created they create only a single ob

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-30 Thread Denis Kudriashov
Hi 2016-08-30 8:52 GMT+02:00 Norbert Hartl : > I think for the 0 case we should think about instantiating the > SubscriptionRegistry lazily. This would also mitigate the effect that if a > lot of announcers are created they create only a single object instead of > two until used. Of course this d

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Norbert Hartl
> Am 30.08.2016 um 06:38 schrieb Stephan Eggermont : > > On 29/08/16 22:37, Denis Kudriashov wrote: >> It looks quite safe to not check anything because subscription items are >> instances of AnnouncementSubscription which are created internally >> inside Announcer during subscription > > We sho

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread stepharo
Le 29/8/16 à 21:37, Tudor Girba a écrit : Hi Denis, Thanks a lot for this analysis! In summary, the Bloc events are faster because: 1. they store the subscriptions in OrderedCollection instead of IdentitySet. This is likely something we can improve in Announcements. 2. they are unsafe. For

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Stephan Eggermont
On 29/08/16 22:37, Denis Kudriashov wrote: It looks quite safe to not check anything because subscription items are instances of AnnouncementSubscription which are created internally inside Announcer during subscription We should probably do something special for 0 and 1 subscriptions. Stephan

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Tudor Girba
> On Aug 29, 2016, at 10:37 PM, Denis Kudriashov wrote: > > > 2016-08-29 21:50 GMT+02:00 Yuriy Tymchuk : > > For 1., the only reason I can think of is to prevent the user to register > > twice the same object by mistake. I think this is an optimization that > > should be the responsibility of

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Denis Kudriashov
2016-08-29 21:50 GMT+02:00 Yuriy Tymchuk : > > For 1., the only reason I can think of is to prevent the user to > register twice the same object by mistake. I think this is an optimization > that should be the responsibility of the user. > > Alternatively we may use OrderedCollection and just chec

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Yuriy Tymchuk
> On 29 Aug 2016, at 21:37, Tudor Girba wrote: > > Hi Denis, > > Thanks a lot for this analysis! > > In summary, the Bloc events are faster because: > 1. they store the subscriptions in OrderedCollection instead of IdentitySet. > This is likely something we can improve in Announcements. > 2.

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Tudor Girba
Hi Denis, Thanks a lot for this analysis! In summary, the Bloc events are faster because: 1. they store the subscriptions in OrderedCollection instead of IdentitySet. This is likely something we can improve in Announcements. 2. they are unsafe. For 1., the only reason I can think of is to preve

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread stepharo
o.org] On Behalf Of Glenn Cavarlé Sent: Sunday, August 28, 2016 9:11 PM To: pharo-dev@lists.pharo.org Subject: [Pharo-dev] About the non-use of Announcer in Bloc Hi all, Doru, Stephan, Norbert, Denis and me spoke at ESUG about the non-use of Announcer in Bloc. I made some test cases in Bloc-Test

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread stepharo
Thanks Glenn!!! Hi all, Doru, Stephan, Norbert, Denis and me spoke at ESUG about the non-use of Announcer in Bloc. I made some test cases in Bloc-Tests to compare performances between Announcer and BlEventRegistry. The result is that Announcer is at least 5x slower in all tes

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Denis Kudriashov
And now question is why SubscriptionRegistry manages subscriptions as IdentitySet instead of OrderedCollection? 2016-08-29 18:36 GMT+02:00 Denis Kudriashov : > And expenses to deliver announcement caused also by protection and usage > of IdentitySet. > Also in announcements we first collect all s

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Denis Kudriashov
And expenses to deliver announcement caused also by protection and usage of IdentitySet. Also in announcements we first collect all subscriptions with interest to separate collection and only after we iterate and process given announcement. But in Bloc you use #select:thenDo: method instead. It is

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Denis Kudriashov
Thank's. I try tests for subscribing and what I found is: Main problem that subscriptions inside SubscriptionRegistry are managed as IdentitySet which of cause much slower for addition then OrderedCollection. We probably could use OrderedCollection here because items are always created on fly and

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Glenn Cavarlé
Ha... tag doesn't work... You can load Bloc and show the tests using this script: Gofer it smalltalkhubUser: 'Pharo' project: 'Bloc'; configuration; loadDevelopment. Gofer it smalltalkhubUser: 'Pharo' project: 'Bloc'; package: 'Bloc-Tests'; load. BlAnnouncerVsBlEventRegi

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Tudor Girba
Hi, You can find the current Bloc image here: https://ci.inria.fr/moose/job/bloc/lastSuccessfulBuild/artifact/bloc.zip Cheers, Doru > On Aug 29, 2016, at 5:10 PM, Denis Kudriashov wrote: > > And could you write current repository? > > 2016-08-29 16:31 GMT+02:00 Glenn Cavarlé : > You can load

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Denis Kudriashov
And could you write current repository? 2016-08-29 16:31 GMT+02:00 Glenn Cavarlé : > You can load Bloc and show the tests using this script: > > > > > - > Glenn Cavarlé > -- > View this message in context: http://forum.world.st/About- > the-non-use-of-Announcer-in-Bloc-tp4913008p4913079.html

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Tudor Girba
Hi, And the script is? :) Doru > On Aug 29, 2016, at 4:31 PM, Glenn Cavarlé wrote: > > You can load Bloc and show the tests using this script: > > > > > - > Glenn Cavarlé > -- > View this message in context: > http://forum.world.st/About-the-non-use-of-Announcer-in-Bloc-tp4913008p491

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Glenn Cavarlé
You can load Bloc and show the tests using this script: - Glenn Cavarlé -- View this message in context: http://forum.world.st/About-the-non-use-of-Announcer-in-Bloc-tp4913008p4913079.html Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-29 Thread Denis Kudriashov
Hi 2016-08-29 8:25 GMT+02:00 Tudor Girba : > Hi Glenn, > > Thanks a lot for this experiment. Could you send us the code snippet so > people can play with it? > Or some links where to download image with Bloc-Tests

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-28 Thread Tudor Girba
Hi Glenn, Thanks a lot for this experiment. Could you send us the code snippet so people can play with it? The question is if perhaps we can identify a slimmer announcement support so that people can choose depending on requirements (e.g. parallelism or not). Cheers, Doru -- www.tudorgirba.co

Re: [Pharo-dev] About the non-use of Announcer in Bloc

2016-08-28 Thread Henrik Nergaard
Glenn Cavarlé Sent: Sunday, August 28, 2016 9:11 PM To: pharo-dev@lists.pharo.org Subject: [Pharo-dev] About the non-use of Announcer in Bloc Hi all, Doru, Stephan, Norbert, Denis and me spoke at ESUG about the non-use of Announcer in Bloc. I made some test cases in Bloc-Tests to compare

[Pharo-dev] About the non-use of Announcer in Bloc

2016-08-28 Thread Glenn Cavarlé
Hi all, Doru, Stephan, Norbert, Denis and me spoke at ESUG about the non-use of Announcer in Bloc. I made some test cases in Bloc-Tests to compare performances between Announcer and BlEventRegistry. The result is that Announcer is at least 5x slower in all tested cases. Bloc has only specific need