gaul/modernizer-maven-plugin

Possible minor optimization in case of package and class name ignores

Closed this issue · 5 comments

while I was working on #67 for #64 I realized hat you could probably do a minor optimization... in case of package ignores (and the same goes for and class name ignores from my contribution; I've stuck to your style instead of mixing this idea into that change), then you should be able to return much earlier than the code currently does?

As is, the ignore is handled in the private checkToken() but that is per statement, right? So your checking entire packages or classes knowning that no violation in tem will ultimately ever be added to occurrences...

Move ignorePackages.contains(packageName) from checkToken to ignoreClass() (from my change), and the visit() method could return early if (ignoreClass()) ? Not sure what MethodVisitor it would have to turn, but I'm guessing there's a NOOP one.

gaul commented

This may make sense. If you run modernizer on a large code base can you see if this optimization helps?

@gaul will do once I actually use modernizer-maven-plugin; still waiting for #69 ... ;-)

gaul commented

@vorburger Can you investigate this?

@gaul Hallo! Unfortunately I meanwhile no longer work (on a project) with modernizer-maven-plugin, so probably won't get to this; sorry, but sure you understand. Therefore, from my side, absolutely no objection taken if you just close this issue now. If you think it could still be of interest / future for you / other users to do, keep it open - up to you.

gaul commented

Closing this out as stale.