gradle-native
gradle-native copied to clipboard
Reduce model rule duplication in JNI library plugin
The current performance regression points to the rule execution code. One reason for spending so much time in that section of the code is how rules are registered for the JNI library plugin. Back when we migrated the JNI library plugin to the universal model, the concept of components wasn't fully fledged out. We were still rolling with the vanilla Gradle mentality which often causes unwanted rules to execute. To solve this, we took the decision to apply rules per model object which, in hindsight, was a bad idea in a multi-variant scenario. It causes far too many one-off rules to be registered and checked every time a component changes. Instead, we should strive to apply the rules based on the present component which automatically solves the issue with unwanted rules execution.