Artiweb > Pull Request #3013

Fix non duplicate feature perf #3013

Github

Description

I optimized the non duplicate app feature calculation by caching a map rule name => [RuleApp]. This lead to an overall performance gain of about 20% for most cost computations done by the strategies.

I made some assumptions about Node that are not guaranteed by the interface (although I think they should be and Node could easily be made immutable). See the doc of getRuleAppsWithName.

Two more things I noticed: * NonDuplicateAppFeature::containsRuleApp is always inverted * Inverting the method to "does not contain" makes the code equal to noDuplicateFindTaclet, so I called this one instead

Is this really the case? NonDuplicateAppFeature::filter does a (now useless) case distinction over whether the position in occurrence is null and calls one of the two methods... It would be very odd if they did the same thing. Why would it be there if they were?

Artifacts