-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Issue #6328 - avoid binding WebSocket MethodHandles #8087
Issue #6328 - avoid binding WebSocket MethodHandles #8087
Conversation
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.
Pretty good.... but naming needs improvement.
Also I question the need for sparse binding of args. It would be more efficient to only support the same binding style as MethodHandle
...e-common/src/main/java/org/eclipse/jetty/websocket/core/internal/util/JettyMethodHandle.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxMessagePartialMethodHandle.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingJettyMethodHandle.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingJettyMethodHandle.java
Outdated
Show resolved
Hide resolved
...rc/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingJettyMethodHandle.java
Outdated
Show resolved
Hide resolved
...ain/java/org/eclipse/jetty/websocket/javax/common/messages/DecodedTextStreamMessageSink.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/eclipse/jetty/websocket/core/internal/util/AbstractJettyMethodHandle.java
Outdated
Show resolved
Hide resolved
...n/src/main/java/org/eclipse/jetty/websocket/core/internal/util/BindingJettyMethodHandle.java
Outdated
Show resolved
Hide resolved
...on/src/main/java/org/eclipse/jetty/websocket/core/internal/messages/AbstractMessageSink.java
Outdated
Show resolved
Hide resolved
...src/main/java/org/eclipse/jetty/websocket/core/internal/messages/InputStreamMessageSink.java
Outdated
Show resolved
Hide resolved
...mmon/src/main/java/org/eclipse/jetty/websocket/core/internal/messages/ReaderMessageSink.java
Outdated
Show resolved
Hide resolved
...mmon/src/main/java/org/eclipse/jetty/websocket/core/internal/messages/StringMessageSink.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/eclipse/jetty/websocket/javax/common/JavaxMessagePartialMethodHolder.java
Outdated
Show resolved
Hide resolved
.../main/java/org/eclipse/jetty/websocket/javax/common/messages/AbstractDecodedMessageSink.java
Show resolved
Hide resolved
...rc/main/java/org/eclipse/jetty/websocket/javax/common/messages/DecodedBinaryMessageSink.java
Show resolved
Hide resolved
...n/java/org/eclipse/jetty/websocket/javax/common/messages/DecodedBinaryStreamMessageSink.java
Show resolved
Hide resolved
.../src/main/java/org/eclipse/jetty/websocket/javax/common/messages/DecodedTextMessageSink.java
Show resolved
Hide resolved
...ain/java/org/eclipse/jetty/websocket/javax/common/messages/DecodedTextStreamMessageSink.java
Show resolved
Hide resolved
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.
Getting there...
...t-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/util/MethodHolder.java
Outdated
Show resolved
Hide resolved
...t-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/util/MethodHolder.java
Outdated
Show resolved
Hide resolved
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Outdated
Show resolved
Hide resolved
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Outdated
Show resolved
Hide resolved
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Outdated
Show resolved
Hide resolved
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Outdated
Show resolved
Hide resolved
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Outdated
Show resolved
Hide resolved
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.
I'm down to tiny quibbles now.
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Outdated
Show resolved
Hide resolved
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Outdated
Show resolved
Hide resolved
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Outdated
Show resolved
Hide resolved
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Outdated
Show resolved
Hide resolved
...t-core-common/src/main/java/org/eclipse/jetty/websocket/core/internal/util/MethodHolder.java
Outdated
Show resolved
Hide resolved
.../src/main/java/org/eclipse/jetty/websocket/core/internal/messages/ByteBufferMessageSink.java
Outdated
Show resolved
Hide resolved
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Show resolved
Hide resolved
...mon/src/main/java/org/eclipse/jetty/websocket/core/internal/util/NonBindingMethodHolder.java
Outdated
Show resolved
Hide resolved
Do we want this in Jetty 10.0.10 release? |
@joakime no this does not need to be in the I think it also needs some performance testing to assess the impact of this. |
Skipping this release, moving to 10.0.12 / 11.0.12 release. |
@lachlan-roberts you can merge this one now. |
@lachlan-roberts can this be merged? |
@joakime no, the benchmarks indicated that using the wrapper around methodhandle is significantly slower. So we need to further assess the performance impact this change would have. I don't think this should be classified as a bug, the current usage of MethodHandles is not wrong. |
Moving this to 10.0.14 then. |
@lachlan-roberts what's the status of this one? Should it be moved back to Draft status? |
@janbartel yes I converted it back to a draft. Maybe this PR is something we want to consider for Jetty 12. |
@lachlan-roberts I've asked the OP what their status is. I would think this is something we want to do for 10/11/12 or not at all. If there is a net benefit, then best to keep the code similar in all branches. |
Signed-off-by: Lachlan Roberts <[email protected]>
68e6e9c
to
e07b8b4
Compare
closing in favor of #10750 for Jetty 12 |
Fixes #6328
Use a new
JettyMethodHandle
interface so that implementations can be used which avoid binding the MethodHandles for each WebSocket connection. This will avoid the multiple spikes seen on the flamegraph from #6328.For Javax endpoints we are creating new method handles each time because we cannot have the same MetaData cache as used in the
JettyWebSocketFrameHandlerFactory
because it depends on both the endpointClass and the endpointConfig. Howeverjavax.websocket.MessageHandler
does not actually use method handles at all and has a special implementation ofJettyMethodHandle
.