Skip to content

Conversation

@gsmet
Copy link
Member

@gsmet gsmet commented Dec 9, 2025

It allows to avoid performing very badly when we have lots of beans of the same type, for instance when you have a lot of Panache repositories for various entities.

We materialize things with Lists in the end, and they might be a bit more optimized than before for small non-singleton lists.

The downside is that we have a bit more allocations but from my testing, it wasn't affecting startup times.

Fixes #51468

We went from (see elements on the left side):

Screenshot From 2025-12-09 15-35-23

to

Screenshot From 2025-12-09 15-35-28

The rest of the ArC container initialization is mostly class loading.

It allows to avoid performing very badly when we have lots of beans of
the same type, for instance when you have a lot of Panache repositories
for various entities.

We materialize things with Lists in the end, and they might be a bit more
optimized than before for small non-singleton lists.

The downside is that we have a bit more allocations but from my testing,
it wasn't affecting startup times.

Fixes quarkusio#51468
@quarkus-bot quarkus-bot bot added the area/arc Issue related to ARC (dependency injection) label Dec 9, 2025
@quarkus-bot
Copy link

quarkus-bot bot commented Dec 9, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit e29b86a.

Failing Jobs

Status Name Step Failures Logs Raw logs Build scan
Native Tests - Windows support Setup GraalVM ⚠️ Check → Logs Raw logs 🚧

You can consult the Develocity build scans.


Flaky tests - Develocity

⚙️ JVM Tests - JDK 21

📦 extensions/quartz/deployment

io.quarkus.quartz.test.timezone.TriggerPrevFireTimeZoneTest.testScheduledJobs - History

  • expected: <2025-12-09T16:00:35Z> but was: <2025-12-09T16:00:36Z> - org.opentest4j.AssertionFailedError
org.opentest4j.AssertionFailedError: expected: <2025-12-09T16:00:35Z> but was: <2025-12-09T16:00:36Z>
	at org.junit.jupiter.api.AssertionFailureBuilder.build(AssertionFailureBuilder.java:151)
	at org.junit.jupiter.api.AssertionFailureBuilder.buildAndThrow(AssertionFailureBuilder.java:132)
	at org.junit.jupiter.api.AssertEquals.failNotEqual(AssertEquals.java:197)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:182)
	at org.junit.jupiter.api.AssertEquals.assertEquals(AssertEquals.java:177)
	at org.junit.jupiter.api.Assertions.assertEquals(Assertions.java:1145)
	at io.quarkus.quartz.test.timezone.TriggerPrevFireTimeZoneTest.testScheduledJobs(TriggerPrevFireTimeZoneTest.java:71)

⚙️ JVM Tests - JDK 21 Semeru

📦 extensions/micrometer-opentelemetry/deployment

io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod_Uni - History

  • Stream has no elements - java.lang.IllegalArgumentException
java.lang.IllegalArgumentException: Stream has no elements
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lambda$lastReading$2(MetricDataFilter.java:213)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReading(MetricDataFilter.java:213)
	at io.quarkus.micrometer.opentelemetry.deployment.common.MetricDataFilter.lastReadingDataPoint(MetricDataFilter.java:231)
	at io.quarkus.micrometer.opentelemetry.deployment.compatibility.MicrometerTimedInterceptorTest.testTimeMethod_Uni(MicrometerTimedInterceptorTest.java:174)
	at java.base/java.lang.reflect.Method.invoke(Method.java:586)
	at io.quarkus.test.QuarkusUnitTest.runExtensionMethod(QuarkusUnitTest.java:532)

⚙️ MicroProfile TCKs Tests

📦 tcks/microprofile-lra

org.eclipse.microprofile.lra.tck.TckRecoveryTests.testCancelWhenParticipantIsUnavailable - History

  • Expecting the metric Compensated callback was called Expected: a value equal to or greater than <1> but: <0> was less than <1> - java.lang.AssertionError
java.lang.AssertionError: 
Expecting the metric Compensated callback was called
Expected: a value equal to or greater than <1>
     but: <0> was less than <1>
	at org.hamcrest.MatcherAssert.assertThat(MatcherAssert.java:20)
	at org.eclipse.microprofile.lra.tck.TckRecoveryTests.assertMetricCallbackCalled(TckRecoveryTests.java:210)
	at org.eclipse.microprofile.lra.tck.TckRecoveryTests.testCancelWhenParticipantIsUnavailable(TckRecoveryTests.java:195)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

Copy link
Contributor

@mkouba mkouba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good. In terms of allocations, this could sometimes allocate more (new HashSet() + List.copyOf()) but I think that in most cases it will be fine.

@gsmet
Copy link
Member Author

gsmet commented Dec 10, 2025

Yeah I did some allocation profiling after this change and it did allocate a bit more, which is not surprising. It wasn't that bad though.

@gsmet gsmet merged commit f1cc639 into quarkusio:main Dec 10, 2025
63 of 64 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.31 - main milestone Dec 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/arc Issue related to ARC (dependency injection) triage/flaky-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ArcContainerImpl#precomputeBeanRawTypes slow when a lot of beans of the same type

2 participants