Re: [Pharo-users] why is adding instance variables so slow?

2017-04-16 Thread Tudor Girba
Hi, Please let’s move this discussion on pharo-dev. And keep going :) Cheers, Doru > On Apr 14, 2017, at 12:09 PM, Denis Kudriashov wrote: > > > 2017-04-14 11:09 GMT+02:00 teso...@gmail.com : > Hi, I think the problem was not clearly explained.

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-14 Thread Denis Kudriashov
2017-04-14 11:09 GMT+02:00 teso...@gmail.com : > Hi, I think the problem was not clearly explained. This is the scenario > that is problematic. > This scenario does not happen in the new Spur implementation of > forwarding, but I think is happening in the old one. > > 1. You

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-14 Thread Denis Kudriashov
2017-04-14 10:51 GMT+02:00 teso...@gmail.com : > Hi Denis, > in the script you are not generating instances of Class1, the problem > is with the instances. > But it generates: c1 := Class1 new. Or what kind of generation you mean?

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-14 Thread Igor Stasenko
i don't see much difference comparing to old implementation of #becomeForward: the only issue is that #allInstances could report same instance twice first, it will find an old instance (that is forwards to new one) and so, add it to results array, and then walking the heap further will find a new

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-14 Thread teso...@gmail.com
Hi, I think the problem was not clearly explained. This is the scenario that is problematic. This scenario does not happen in the new Spur implementation of forwarding, but I think is happening in the old one. 1. You have, let's say 3 instances of ClassA. 2. You add a new instance variable to

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-14 Thread Igor Stasenko
On 12 April 2017 at 14:17, Guillermo Polito wrote: > > > On Wed, Apr 12, 2017 at 11:35 AM, Denis Kudriashov > wrote: > >> >> 2017-04-12 10:55 GMT+02:00 Guillermo Polito : >> >>> PharoClassInstaller>>migrateClasses: old

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-14 Thread teso...@gmail.com
Hi Denis, in the script you are not generating instances of Class1, the problem is with the instances. Cheers, Pablo On Fri, Apr 14, 2017 at 10:04 AM, Denis Kudriashov wrote: > > 2017-04-12 13:29 GMT+02:00 teso...@gmail.com : > >> Hi, >> in non

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-14 Thread Igor Stasenko
On 14 April 2017 at 10:19, Stephane Ducasse wrote: > But I do not get how doing that would handle the old instances? > Because you want to migrate the old instances. > > +1 there are no such thing as 'bad zombies', if they are there, it means you either don't care about

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-14 Thread Denis Kudriashov
2017-04-12 13:29 GMT+02:00 teso...@gmail.com : > Hi, > in non spur, the only improve that I think it can be made safely is > moving the garbage collect operation to the migration of instances side, > only executing the garbage collect if there are instances. > > In spur the

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-14 Thread Denis Kudriashov
2017-04-14 9:19 GMT+02:00 Stephane Ducasse : > But I do not get how doing that would handle the old instances? > Because you want to migrate the old instances. > But my example shows that old instances not exist after becomeFormard operation. Or what you mean?

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-14 Thread Stephane Ducasse
But I do not get how doing that would handle the old instances? Because you want to migrate the old instances. Stef On Wed, Apr 12, 2017 at 1:26 PM, Denis Kudriashov wrote: > > 2017-04-12 13:17 GMT+02:00 Guillermo Polito : > >> 1) each

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-12 Thread teso...@gmail.com
Hi, in non spur, the only improve that I think it can be made safely is moving the garbage collect operation to the migration of instances side, only executing the garbage collect if there are instances. In spur the garbage collect it is not needed anymore, because the way the become is

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-12 Thread Denis Kudriashov
2017-04-12 13:17 GMT+02:00 Guillermo Polito : > 1) each instance of A is becomed into its corresponding instance of A' > 2) finally we become class A into A' > This step will make that old instances of A now have: > - the old format > - but

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-12 Thread Guillermo Polito
On Wed, Apr 12, 2017 at 11:35 AM, Denis Kudriashov wrote: > > 2017-04-12 10:55 GMT+02:00 Guillermo Polito : > >> PharoClassInstaller>>migrateClasses: old to: new using: >>> anInstanceModification >>> instanceModification := anInstanceModification.

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-12 Thread Denis Kudriashov
2017-04-12 10:55 GMT+02:00 Guillermo Polito : > PharoClassInstaller>>migrateClasses: old to: new using: >> anInstanceModification >> instanceModification := anInstanceModification. >> old ifEmpty: [ ^ self ]. >> [ >> 1 to: old size do: [ :index | >> self updateClass:

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-12 Thread Guillermo Polito
On Wed, Apr 12, 2017 at 10:51 AM, Denis Kudriashov wrote: > Hi. > > I profiled a bit and found problem: > > PharoClassInstaller>>migrateClasses: old to: new using: > anInstanceModification > instanceModification := anInstanceModification. > old ifEmpty: [ ^ self ]. > [ > 1

Re: [Pharo-users] why is adding instance variables so slow?

2017-04-12 Thread Denis Kudriashov
Hi. I profiled a bit and found problem: PharoClassInstaller>>migrateClasses: old to: new using: anInstanceModification instanceModification := anInstanceModification. old ifEmpty: [ ^ self ]. [ 1 to: old size do: [ :index | self updateClass: (old at: index) to: (new at: index)]. old

[Pharo-users] why is adding instance variables so slow?

2017-04-12 Thread Peter Uhnak
Hi, does anyone know why adding instance variables is so slow? I did some quick benchmarks (see below), resulting in more than order of magnitude speed difference between having it in the class definition and adding it later. In fact it is still much faster to delete the class and then