Skip to content

Commit

Permalink
ComponentsProviderGenerator - lower group limit for addRemovedBeans()
Browse files Browse the repository at this point in the history
- to eliminate the perf regression caused by
MethodWriter#computeAllFrames() and Frame#merge()
- resolves quarkusio#24712
  • Loading branch information
mkouba committed Apr 4, 2022
1 parent d32cfec commit 3133199
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
}
Expand All @@ -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
Expand Down

0 comments on commit 3133199

Please sign in to comment.