From 3133199cbb457886e53e8a11131ef35561da01ce Mon Sep 17 00:00:00 2001 From: Martin Kouba Date: Mon, 4 Apr 2022 09:29:36 +0200 Subject: [PATCH] ComponentsProviderGenerator - lower group limit for addRemovedBeans() - to eliminate the perf regression caused by MethodWriter#computeAllFrames() and Frame#merge() - resolves #24712 --- .../arc/processor/ComponentsProviderGenerator.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ComponentsProviderGenerator.java b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ComponentsProviderGenerator.java index 8107dcdf3a83f..2a2a45645052d 100644 --- a/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ComponentsProviderGenerator.java +++ b/independent-projects/arc/processor/src/main/java/io/quarkus/arc/processor/ComponentsProviderGenerator.java @@ -410,6 +410,11 @@ public RemovedBeanAdder(ClassCreator componentsProvider, MethodCreator getCompon this.typeCache = new MapTypeCache(); } + @Override + protected int groupLimit() { + return 5; + } + @Override MethodCreator newAddMethod() { // Clear the shared maps for each addRemovedBeansX() method @@ -687,7 +692,7 @@ public void close() { void addComponent(T component) { - if (addMethod == null || componentsAdded >= GROUP_LIMIT) { + if (addMethod == null || componentsAdded >= groupLimit()) { if (addMethod != null) { addMethod.returnValue(null); } @@ -709,6 +714,10 @@ void addComponent(T component) { abstract void addComponentInternal(T component); + protected int groupLimit() { + return GROUP_LIMIT; + } + } // This wrapper is needed because AnnotationInstance#equals() compares the annotation target