Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

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

Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

Paul DeBruicker
I think I'm setting this up wrong in Pharo 4 but am not sure.  I use the following code for the test:


rule:=RBClassNotReferencedRule new.
environment:=RBBrowserEnvironment new forPackageNames: #('MyPackage').
       
       
AndreasSystemProfiler spyOn:[RBSmalllintChecker runRule: rule onEnvironment: environment]
       

In Pharo 4 it spends most of the time in  Behavior>>#includesDefinedSelector:ofClassName: and takes 300s.  In Pharo 3 its only 1.5 s

Is there something that can be done to get Pharo 4 up to the speed of Pharo 3?


Thanks

Paul
Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

stepharo
Thanks for the question.
It looks like we got a regression.

Le 29/7/15 06:04, Paul DeBruicker a écrit :

> I think I'm setting this up wrong in Pharo 4 but am not sure.  I use the following code for the test:
>
>
> rule:=RBClassNotReferencedRule new.
> environment:=RBBrowserEnvironment new forPackageNames: #('MyPackage').
>
>
> AndreasSystemProfiler spyOn:[RBSmalllintChecker runRule: rule onEnvironment: environment]
>
>
> In Pharo 4 it spends most of the time in  Behavior>>#includesDefinedSelector:ofClassName: and takes 300s.  In Pharo 3 its only 1.5 s
>
> Is there something that can be done to get Pharo 4 up to the speed of Pharo 3?
>
>
> Thanks
>
> Paul
>


Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

stepharo
In reply to this post by Paul DeBruicker
Paul

I wanted to check on Pharo 50 but we need a comparison point. We should
get the same package.
Do you have an idea of a package that did not change much?

Setf

Le 29/7/15 06:04, Paul DeBruicker a écrit :

> I think I'm setting this up wrong in Pharo 4 but am not sure.  I use the following code for the test:
>
>
> rule:=RBClassNotReferencedRule new.
> environment:=RBBrowserEnvironment new forPackageNames: #('MyPackage').
>
>
> AndreasSystemProfiler spyOn:[RBSmalllintChecker runRule: rule onEnvironment: environment]
>
>
> In Pharo 4 it spends most of the time in  Behavior>>#includesDefinedSelector:ofClassName: and takes 300s.  In Pharo 3 its only 1.5 s
>
> Is there something that can be done to get Pharo 4 up to the speed of Pharo 3?
>
>
> Thanks
>
> Paul
>


Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

Paul DeBruicker
Hi Stef,

The slowdown is dependent upon the # of classes in the package.  If you use Fuel then you should see a slowdown of 20x.  I just have a lot of classes in this package.  The source of the slowdown is in the changes to RBSmallLintChecker>>#checkClass: and RBClassNotReferencedRule>>#checkClass: .   The old versions use the linter to check if the literal is used anywhere and the new one uses #allCallsOn.


Hope this helps

Paul
Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

Paul DeBruicker
Paul DeBruicker wrote
Hi Stef,

The slowdown is dependent upon the # of classes in the package.  If you use Fuel then you should see a slowdown of 20x.  I just have a lot of classes in this package.  The source of the slowdown is in the changes to RBSmallLintChecker>>#checkClass: and RBClassNotReferencedRule>>#checkClass: .   The old versions use the linter to check if the literal is used anywhere and the new one uses #allCallsOn.


Hope this helps

Paul

and by "use Fuel" I mean:

rule:=RBClassNotReferencedRule new.
environment:=RBBrowserEnvironment new forPackageNames: #('Fuel').
       
       
AndreasSystemProfiler spyOn:[RBSmalllintChecker runRule: rule onEnvironment: environment]
       


Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

stepharo
In reply to this post by Paul DeBruicker
Paul

I'm running out of town.
Could you open a bug entry with the information you have so that we do
not forget?

Stef

Le 29/7/15 17:33, Paul DeBruicker a écrit :

> Hi Stef,
>
> The slowdown is dependent upon the # of classes in the package.  If you use
> Fuel then you should see a slowdown of 20x.  I just have a lot of classes in
> this package.  The source of the slowdown is in the changes to
> RBSmallLintChecker>>#checkClass: and RBClassNotReferencedRule>>#checkClass:
> .   The old versions use the linter to check if the literal is used anywhere
> and the new one uses #allCallsOn.
>
>
> Hope this helps
>
> Paul
>
>
>
> --
> View this message in context: http://forum.world.st/Is-RBClassNotReferencedRule-200x-slower-in-Pharo-4-vs-Pharo-3-tp4839875p4839976.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

Marcus Denker-4
In reply to this post by Paul DeBruicker
I added an issue:


i think we need to put in some cashing… here if we would could all *used* classes once for an enviroment….

On 29 Jul 2015, at 17:33, Paul DeBruicker <[hidden email]> wrote:

Paul DeBruicker wrote
Hi Stef,

The slowdown is dependent upon the # of classes in the package.  If you
use Fuel then you should see a slowdown of 20x.  I just have a lot of
classes in this package.  The source of the slowdown is in the changes to
RBSmallLintChecker>>#checkClass: and
RBClassNotReferencedRule>>#checkClass: .   The old versions use the linter
to check if the literal is used anywhere and the new one uses #allCallsOn.


Hope this helps

Paul


and by "use Fuel" I mean:

rule:=RBClassNotReferencedRule new.
environment:=RBBrowserEnvironment new forPackageNames: #('Fuel').


AndreasSystemProfiler spyOn:[RBSmalllintChecker runRule: rule onEnvironment:
environment]







--
View this message in context: http://forum.world.st/Is-RBClassNotReferencedRule-200x-slower-in-Pharo-4-vs-Pharo-3-tp4839875p4839977.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

stepharo
Hi marcus

do you get an idea why we got this slowdown?

Stef

Le 30/7/15 14:08, Marcus Denker a écrit :
I added an issue:


i think we need to put in some cashing… here if we would could all *used* classes once for an enviroment….

On 29 Jul 2015, at 17:33, Paul DeBruicker <[hidden email]> wrote:

Paul DeBruicker wrote
Hi Stef,

The slowdown is dependent upon the # of classes in the package.  If you
use Fuel then you should see a slowdown of 20x.  I just have a lot of
classes in this package.  The source of the slowdown is in the changes to
RBSmallLintChecker>>#checkClass: and
RBClassNotReferencedRule>>#checkClass: .   The old versions use the linter
to check if the literal is used anywhere and the new one uses #allCallsOn.


Hope this helps

Paul


and by "use Fuel" I mean:

rule:=RBClassNotReferencedRule new.
environment:=RBBrowserEnvironment new forPackageNames: #('Fuel').


AndreasSystemProfiler spyOn:[RBSmalllintChecker runRule: rule onEnvironment:
environment]







--
View this message in context: http://forum.world.st/Is-RBClassNotReferencedRule-200x-slower-in-Pharo-4-vs-Pharo-3-tp4839875p4839977.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.



Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

Uko2
This may have happened when I was removing contexts from the rules.

Uko

On 18 Aug 2015, at 18:25, stepharo <[hidden email]> wrote:

Hi marcus

do you get an idea why we got this slowdown?

Stef

Le 30/7/15 14:08, Marcus Denker a écrit :
I added an issue:


i think we need to put in some cashing… here if we would could all *used* classes once for an enviroment….

On 29 Jul 2015, at 17:33, Paul DeBruicker <[hidden email]> wrote:

Paul DeBruicker wrote
Hi Stef,

The slowdown is dependent upon the # of classes in the package.  If you
use Fuel then you should see a slowdown of 20x.  I just have a lot of
classes in this package.  The source of the slowdown is in the changes to
RBSmallLintChecker>>#checkClass: and
RBClassNotReferencedRule>>#checkClass: .   The old versions use the linter
to check if the literal is used anywhere and the new one uses #allCallsOn.


Hope this helps

Paul


and by "use Fuel" I mean:

rule:=RBClassNotReferencedRule new.
environment:=RBBrowserEnvironment new forPackageNames: #('Fuel').


AndreasSystemProfiler spyOn:[RBSmalllintChecker runRule: rule onEnvironment:
environment]







--
View this message in context: http://forum.world.st/Is-RBClassNotReferencedRule-200x-slower-in-Pharo-4-vs-Pharo-3-tp4839875p4839977.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

Marcus Denker-4

On 18 Aug 2015, at 22:39, Yuriy Tymchuk <[hidden email]> wrote:

This may have happened when I was removing contexts from the rules.


I think the reason is that there was a cache in the context. But we need to check.

Uko

On 18 Aug 2015, at 18:25, stepharo <[hidden email]> wrote:

Hi marcus

do you get an idea why we got this slowdown?

Stef

Le 30/7/15 14:08, Marcus Denker a écrit :
I added an issue:


i think we need to put in some cashing… here if we would could all *used* classes once for an enviroment….

On 29 Jul 2015, at 17:33, Paul DeBruicker <[hidden email]> wrote:

Paul DeBruicker wrote
Hi Stef,

The slowdown is dependent upon the # of classes in the package.  If you
use Fuel then you should see a slowdown of 20x.  I just have a lot of
classes in this package.  The source of the slowdown is in the changes to
RBSmallLintChecker>>#checkClass: and
RBClassNotReferencedRule>>#checkClass: .   The old versions use the linter
to check if the literal is used anywhere and the new one uses #allCallsOn.


Hope this helps

Paul


and by "use Fuel" I mean:

rule:=RBClassNotReferencedRule new.
environment:=RBBrowserEnvironment new forPackageNames: #('Fuel').


AndreasSystemProfiler spyOn:[RBSmalllintChecker runRule: rule onEnvironment:
environment]







--
View this message in context: http://forum.world.st/Is-RBClassNotReferencedRule-200x-slower-in-Pharo-4-vs-Pharo-3-tp4839875p4839977.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.





Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

stepharo
In reply to this post by Uko2
yuriy what was a context?

Stef


Le 18/8/15 22:39, Yuriy Tymchuk a écrit :
This may have happened when I was removing contexts from the rules.

Uko

On 18 Aug 2015, at 18:25, stepharo <[hidden email]> wrote:

Hi marcus

do you get an idea why we got this slowdown?

Stef

Le 30/7/15 14:08, Marcus Denker a écrit :
I added an issue:


i think we need to put in some cashing… here if we would could all *used* classes once for an enviroment….

On 29 Jul 2015, at 17:33, Paul DeBruicker <[hidden email]> wrote:

Paul DeBruicker wrote
Hi Stef,

The slowdown is dependent upon the # of classes in the package.  If you
use Fuel then you should see a slowdown of 20x.  I just have a lot of
classes in this package.  The source of the slowdown is in the changes to
RBSmallLintChecker>>#checkClass: and
RBClassNotReferencedRule>>#checkClass: .   The old versions use the linter
to check if the literal is used anywhere and the new one uses #allCallsOn.


Hope this helps

Paul


and by "use Fuel" I mean:

rule:=RBClassNotReferencedRule new.
environment:=RBBrowserEnvironment new forPackageNames: #('Fuel').


AndreasSystemProfiler spyOn:[RBSmalllintChecker runRule: rule onEnvironment:
environment]







--
View this message in context: http://forum.world.st/Is-RBClassNotReferencedRule-200x-slower-in-Pharo-4-vs-Pharo-3-tp4839875p4839977.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.





Reply | Threaded
Open this post in threaded view
|

Re: Is RBClassNotReferencedRule ~200x slower in Pharo 4 vs Pharo 3 ?

Uko2
I need to double check it, for now I cannot access the issue tracker (probably local internet issues).

As far as I remember, the problem was that SmallLint rules where checking contexts and not classes and methods. I.e. you had to create a context, set it’s “selected" class or method, pass it into the rule and then rule would take out class or method out of the context and check them. In my humble opinions this is 1) pain, 2) a bit confuting that #chackClass: method accepts context and not a class.

But I guess at some point there was some caching happening during the check in a certain rules, and now it’s not there.

What I was suggesting is to either define a context attribute for all rules, or even better, define a hierarchy of rules that besides the entity to check accept the context that is needed for the check, as not avery rule requires a context. By default it can be a live context of whale system, but on demand we can create a snapshot of a context (with caches) and pass it to different rules several times. Sadly I never managed to finish implementing it, it’s still in my todo list.

Uko


On 19 Aug 2015, at 09:50, stepharo <[hidden email]> wrote:

yuriy what was a context?

Stef


Le 18/8/15 22:39, Yuriy Tymchuk a écrit :
This may have happened when I was removing contexts from the rules.

Uko

On 18 Aug 2015, at 18:25, stepharo <[hidden email]> wrote:

Hi marcus

do you get an idea why we got this slowdown?

Stef

Le 30/7/15 14:08, Marcus Denker a écrit :
I added an issue:


i think we need to put in some cashing… here if we would could all *used* classes once for an enviroment….

On 29 Jul 2015, at 17:33, Paul DeBruicker <[hidden email]> wrote:

Paul DeBruicker wrote
Hi Stef,

The slowdown is dependent upon the # of classes in the package.  If you
use Fuel then you should see a slowdown of 20x.  I just have a lot of
classes in this package.  The source of the slowdown is in the changes to
RBSmallLintChecker>>#checkClass: and
RBClassNotReferencedRule>>#checkClass: .   The old versions use the linter
to check if the literal is used anywhere and the new one uses #allCallsOn.


Hope this helps

Paul


and by "use Fuel" I mean:

rule:=RBClassNotReferencedRule new.
environment:=RBBrowserEnvironment new forPackageNames: #('Fuel').


AndreasSystemProfiler spyOn:[RBSmalllintChecker runRule: rule onEnvironment:
environment]







--
View this message in context: http://forum.world.st/Is-RBClassNotReferencedRule-200x-slower-in-Pharo-4-vs-Pharo-3-tp4839875p4839977.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.