allOverriddenMethods is confusing

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

allOverriddenMethods is confusing

Stéphane Ducasse
Hi

I just got burned by allOverriddenMethods strange semantics
when sent to a packageInfo instance it returns all the methods overrides of the system
not the ones in the package.

Or I'm silly (highly probable). So may be we are scanning all the system each time we save a package :(

Stef
Reply | Threaded
Open this post in threaded view
|

Re: allOverriddenMethods is confusing

Stéphane Ducasse
So allOverriddenMethods returns all the methods of the complete system and it may be correct but strange to have it on the instance side.
Now my hypothesis is that


> overriddenMethodsDo: aBlock
        "Enumerates the methods the receiver contains which have been overridden by other packages"
        ^ self allOverriddenMethodsDo: [:ea |
                (self isOverrideOfYourMethod: ea)
                        ifTrue: [aBlock value: ea]]

check the complete system for every package snapshot and since we have a lot of override because of polymorph we pay the price.
I will fold the overrides first and try to understand mc


Stef
Reply | Threaded
Open this post in threaded view
|

Re: allOverriddenMethods is confusing

Henrik Sperre Johansen
On Mar 20, 2011, at 9:48 31AM, Stéphane Ducasse wrote:

> So allOverriddenMethods returns all the methods of the complete system and it may be correct but strange to have it on the instance side.
Probably for convenience, so you don't write self class allIOverriden... in methods like the one below.

> Now my hypothesis is that
>
>
>> overriddenMethodsDo: aBlock
> "Enumerates the methods the receiver contains which have been overridden by other packages"
> ^ self allOverriddenMethodsDo: [:ea |
> (self isOverrideOfYourMethod: ea)
> ifTrue: [aBlock value: ea]]
>
> check the complete system for every package snapshot and since we have a lot of override because of polymorph we pay the price.
> I will fold the overrides first and try to understand mc
>
>
> Stef

Yes, allOverridenMethods returns all overrides in the entire system.
Another example of what you have to do when using categories for packaging :)

To figure out the overridden methods in your package, it
- Checks class category is not yours
- Scans source for old category.

Since .changes has been trunkated since Polymorph was merged, you won't find any packages whose methods are actually overridden by the Polymorph overrides :P

Cheers,
Henry

PS. How does RPackage deal with overriden methods?
PPS. I profiled this long ago, while it did show up, removing overrides didn't actually have a noticeable impact on the loading speed of Monticello
Reply | Threaded
Open this post in threaded view
|

Re: allOverriddenMethods is confusing

cdelaunay
I think that this part of RPackage has just been copied from PackageInfo to work quickly with monticello. So for now RPackage deal with overriden methods in the same way than PackageInfo

2011/3/21 Henrik Johansen <[hidden email]>
On Mar 20, 2011, at 9:48 31AM, Stéphane Ducasse wrote:

> So allOverriddenMethods returns all the methods of the complete system and it may be correct but strange to have it on the instance side.
Probably for convenience, so you don't write self class allIOverriden... in methods like the one below.

> Now my hypothesis is that
>
>
>> overriddenMethodsDo: aBlock
>       "Enumerates the methods the receiver contains which have been overridden by other packages"
>       ^ self allOverriddenMethodsDo: [:ea |
>               (self isOverrideOfYourMethod: ea)
>                       ifTrue: [aBlock value: ea]]
>
> check the complete system for every package snapshot and since we have a lot of override because of polymorph we pay the price.
> I will fold the overrides first and try to understand mc
>
>
> Stef

Yes, allOverridenMethods returns all overrides in the entire system.
Another example of what you have to do when using categories for packaging :)

To figure out the overridden methods in your package, it
- Checks class category is not yours
- Scans source for old category.

Since .changes has been trunkated since Polymorph was merged, you won't find any packages whose methods are actually overridden by the Polymorph overrides :P

Cheers,
Henry

PS. How does RPackage deal with overriden methods?
PPS. I profiled this long ago, while it did show up, removing overrides didn't actually have a noticeable impact on the loading speed of Monticello

Reply | Threaded
Open this post in threaded view
|

Re: allOverriddenMethods is confusing

Stéphane Ducasse
In reply to this post by Henrik Sperre Johansen
>
>
> Since .changes has been trunkated since Polymorph was merged, you won't find any packages whose methods are actually overridden by the Polymorph overrides :P
>
> Cheers,
> Henry
>
> PS. How does RPackage deal with overriden methods?


it does not :)
No overrides.

> PPS. I profiled this long ago, while it did show up, removing overrides didn't actually have a noticeable impact on the loading speed of Monticello