Marcus Denker-4 wrote
> Hi,
> 
> Review needed for
> 
> 
> https://pharo.fogbugz.com/f/cases/16074/Is-RBClassNotReferencedRule-200x-slower-in-Pharo-4-vs-Pharo-3
> 
> Speedup can be checked with:
> 
> rule:=RBClassNotReferencedRule new.
> environment:=RBBrowserEnvironment new forPackageNames: #('Fuel').
> [RBSmalllintChecker runRule: rule onEnvironment:
> environment] timeToRun 
> 
> 
> Pharo5: "0:00:00:13.526"
> Pharo5 with fix: "0:00:00:00.761"
> Pharo3:  0:00:00:00.547
> 
> Checking all classes for usage:
> 
> [Smalltalk allClassesAndTraits select: [ : each | each isUsed not]]
> timeToRun
> 
> still takes 1:40 to find 600 unused classes.
> 
> This shows that adding a cache for “referenced classes” per environment
> would speed this
> up further. But it should be general, not just for RB or even RB Code
> Critique.
> 
> The nice things is that code environments only change when you add classes
> or methods,
> so adding a very general cache should be quite possible.
> 
> Another thing we should add is a way for classes to define “I am used”.
> E.g this
> now finds all Configurations, all the Manifests and all cases like the RB
> Rules themselves.
> All these should know that they are not useless even though there are no
> references.
> 
>       Marcus

Thanks for working on this.   I have a use for it this week.  

For methods RB allows one to add a pragma e.g.: 

        <lint: 'Methods implemented but not sent' rationale: 'this code plays a
role in examining the system' author: 'pad'>

and described here: http://www.lukas-renggli.ch/blog/ignoring-lint-rules. 
Maybe we can hijack that mechanism with a class side method e.g.

rbNotReferenced
         <lint>


Do your modifications test sends of subclassesDo: and friends?

OR 

#(#MyClass1 #MyClass2 #MyClass3) collect:[:ea | (Smalltalk at: ea)
doSomething].

The reason I ask is I'm planning to do a bunch of cleanup of a package and
it would be nice to not worry about those cases getting missed







--
View this message in context: 
http://forum.world.st/review-needed-speed-up-RBClassNotReferencedRule-tp4845838p4850824.html
Sent from the Pharo Smalltalk Developers mailing list archive at Nabble.com.

Reply via email to