Re: [Pharo-dev] Little challenge

2020-01-10 Thread ducasse
Hello alejandro Thanks for the reminder. I will have a look. S > On 10 Jan 2020, at 12:26, Alejandro Infante > wrote: > > The profiler of my master thesis does this (and a lot more). It instruments > new on all classes in a package + some other core things like String, Color, > Rectangle

Re: [Pharo-dev] Little challenge

2020-01-10 Thread Alejandro Infante
The profiler of my master thesis does this (and a lot more). It instruments new on all classes in a package + some other core things like String, Color, Rectangle and Collections and check if some of them have equivalent state and are immutable. If they are the profiler allows you to group the i

Re: [Pharo-dev] Little challenge

2020-01-09 Thread Sven Van Caekenberghe
Another requirement for caching and sharing instances is that the object is a true read only value object. > On 9 Jan 2020, at 22:45, Esteban Maringolo wrote: > > Well... the theme having these colors in a table of some sort, even > keyed by a role name (very much like windows), isn't like a lo

Re: [Pharo-dev] Little challenge

2020-01-09 Thread Esteban Maringolo
Well... the theme having these colors in a table of some sort, even keyed by a role name (very much like windows), isn't like a lot of work. Of course, "premature optimization is the root of all evil". But given that such "careless" behavior has been around for a while, maybe it is not premature a

Re: [Pharo-dev] Little challenge

2020-01-09 Thread Sean P. DeNigris
ducasse wrote > it looks like a real plague. What is the real effect on performance? There is a cost to the complexity of e.g. caching too, no? - Cheers, Sean -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html

Re: [Pharo-dev] Little challenge

2020-01-08 Thread Alexandre Bergel via Pharo-dev
--- Begin Message --- You are very right. Unfortunately, there are many situation like this. Consider: Point allInstances size "101283" Point allInstances asSet size "11381" 'String' class allInstances size "111492" 'String' class allInstances asSet size “57874" A lot of duplication around… Ch

Re: [Pharo-dev] Little challenge

2020-01-08 Thread ducasse
luckily not :) > On 8 Jan 2020, at 22:07, Esteban Maringolo wrote: > > I'll make the first guess: 10^6 calls. > > Esteban A. Maringolo > > On Wed, Jan 8, 2020 at 6:03 PM ducasse wrote: >> >> So now I know how many instance of colors are created when we switch theme >> and it looks like a r

Re: [Pharo-dev] Little challenge

2020-01-08 Thread Esteban Maringolo
I'll make the first guess: 10^6 calls. Esteban A. Maringolo On Wed, Jan 8, 2020 at 6:03 PM ducasse wrote: > > So now I know how many instance of colors are created when we switch theme > and it looks like a real plague. > I will let you guess the number but this is not a small one :( > > I will

Re: [Pharo-dev] Little challenge

2020-01-08 Thread ducasse
So now I know how many instance of colors are created when we switch theme and it looks like a real plague. I will let you guess the number but this is not a small one :( I will check on my lovely theme if using a dictionary can manage it. > On 8 Jan 2020, at 21:51, ducasse wrote: > > Color

Re: [Pharo-dev] Little challenge

2020-01-08 Thread ducasse
Color >> basicNew Transcript show: '.'; cr. ^ super basicNew This is scary. I will save in a file because we are creating so many spurious colors that it is nearly not possible to see the amount.

[Pharo-dev] Little challenge

2020-01-08 Thread ducasse
Hi I would like know how many instances of Color are instantiated by a theme. I would like to know how many times the same color is created. I’m creating a theme using a dictionary instead of stupidly returning color. May be like that I can use an LRUCache to see the number of hits. I will se

Re: [Pharo-dev] Little challenge

2016-01-10 Thread stepharo
Le 10/1/16 01:56, Eliot Miranda a écrit : BlockClosure and Context. Back in the day OrderedCollection was one (when become was cheap there was no need for the array inst car). Yes I remember in VW. You want to say Smalltalk allClasses select: [:c| c isVariable and: [c instSize > 0]] _,,,

Re: [Pharo-dev] Little challenge

2016-01-09 Thread Eliot Miranda
BlockClosure and Context. Back in the day OrderedCollection was one (when become was cheap there was no need for the array inst car). You want to say Smalltalk allClasses select: [:c| c isVariable and: [c instSize > 0]] _,,,^..^,,,_ (phone) > On Jan 9, 2016, at 1:24 PM, stepharo wrote: > >

Re: [Pharo-dev] Little challenge

2016-01-09 Thread stepharo
We tried (Object allSubclasses select: #isVariable) reject: [ :each | each instVarNames isEmpty ] and we discovered that we have no class in the system with named instance variables and indexed ones. May be we are wrong. We are interested if you find one. Now we created one Obje

[Pharo-dev] Little challenge

2016-01-09 Thread stepharo
We are trying to find examples of variableSubclass:... and with source code we could not find them. Even looking in all the code did not work. finally Object allSubclasses select: #isVariable worked but it would be good that search to the code would take into account classdefinitions. Or may b