-
Notifications
You must be signed in to change notification settings - Fork 124
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
Add new method isEnabled to ConfigSourceInterceptor #1311
Conversation
e139354
to
840d639
Compare
I'm concerned about how this might affect the API. The new Why is the deep call stack a problem (and how deep is "deep")? Perhaps we need to look at allowing the interceptor factory to indicate a pass-through interceptor (for example by returning |
Yes, the goal was to reduce the stack trace on error a bit, because it is a bit long. Currently, a typical Quarkus app has 8 interceptors, plus the chain invoke, adds 16 lines to the trace. I thought about If we change this to just a simple I thought about returning |
If it's just to reduce the stack trace for aesthetic reasons, then I don't know if this is really worthwhile. Was there some kind of complaint or problem that led you to this solution? |
@franz1981 did complain that about it :) I was also hoping that by removing some of the interceptors that do not require to do work (consider the LoggingInterceptor, if there is no logging), which become just a passthrough to improve some things. I didn't notice a considerable improvement (or degradation), but I would still need to collect more data. Still, we let the change in. If you feel this is not required, I can revert the change. |
We don't know yet IIRC (unless Roberto tried it) if it is worthy perf wise, whilst the class value lookup implementation in native image CE (let's underline CE, which is the one which does it bad...) seems so. IDK if @radcortez opened already any issue for that but I can better share what is going on there |
The issue for ClassValue lookup was fixed here #1309 This also requires some Quarkus code, which I haven't pushed yet, to record the ClassValue lookup to populate the cache and avoid the expensive lock of ConcurrentHashMap (which the native image uses as a Substitute of ClassValue). |
Expensive lock of |
It is an issue in the native image only. The When we moved the Vertx HTTP config to use |
And the root cause is here https://github.com/oracle/graal/blob/18996df1503b91f9c7882d969726b5d4ea003209/substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/util/BasedOnJDKClass.java#L41-43 synchronized in native image are based on ReentrantLock and for impl reasons they always end up into the so called slow path shown in the flame by @radcortez |
The goal is to remove the interceptor from the chain if
isEnabled=false
to reduce the stack call, instead of keeping a passthrough interceptor.