jetty.project
jetty.project copied to clipboard
Issue #6328 - avoid binding WebSocket MethodHandles
Issue #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. However javax.websocket.MessageHandler
does not actually use method handles at all and has a special implementation of JettyMethodHandle
.
Do we want this in Jetty 10.0.10 release?
@joakime no this does not need to be in the 10.0.10
release.
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. Can you update the branch against latest 10.0.x and repeat performance tests to check impact.
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.
closing in favor of #10750 for Jetty 12