-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
OASFactoryResolverImpl clinit registry lazy init #1821
Conversation
122b076
to
1bf7267
Compare
Regardless, I'm a bit concerned on the lack of concurrency protection while writing/reading on |
Good idea! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @franz1981 , this looks good. The put
method previously used to load the map can be taken out now too.
core/src/main/java/io/smallrye/openapi/spi/OASFactoryResolverImpl.java
Outdated
Show resolved
Hide resolved
@franz1981 I'm considering doing a release this week and updating the version used by Quarkus (which requires some code changes as well). I think this PR would be good to get in for the release. Are you planning to push another commit to remove the |
Sure thing, I was 100% sure to have pushed it already, but is likely that I didn't, sorry for that! |
1bf7267
to
b9b8edf
Compare
Quality Gate passedIssues Measures |
According to the quarkus start stop tests (at quarkus-qe/quarkus-startstop#371):
https://github.com/quarkusio/quarkus/blob/4eaa586672bbc18a25f3dc82f18201260ee8ce0a/extensions/smallrye-openapi/runtime/src/main/java/io/quarkus/smallrye/openapi/runtime/OpenApiRecorder.java#L98
(which is in the flamegraph, at
io/quarkus/smallrye/openapi/runtime/OpenApiRecorder.classLoaderHack
)cause SPI loading and allocating
OASFactoryResolverImpl
, causing its registry allocation (with the many class loading events it brings...).By default just hitting
nor any of the endpoints, I'm not able to get
OASFactoryResolverImpl::createObject
to be used, but please correct me if I have some naive assumption on how this is supposed to work.WIth this PR the registry allocation/population, would happen lazily, making it lighter and faster application startup if this registry map isn't used.