-
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
Do not use ServiceLoader every time a WebSocketSession is created #4650
Comments
@SerCeMan Good catch! |
I don't think it will be easy to do without using the static, the only way I see of doing it would be to add a method to the I think the best way to do this is probably just as a static on the |
Signed-off-by: Lachlan Roberts <[email protected]>
…Factory Issue #4650 - do not use ServiceLoader every time a WSSession is started
Fixed with PR #4664 |
Jetty version
9.4.27.v20200227
Java version
OS type/version
Ubuntu 18.04.4 LTS
Description
Hey, Jetty Maintainers! After running a benchmark with a few thousands of WebSocket clients, we noticed in the CPU profile (it was also very noticeable in the allocation profile) that jetty scans jars looking for
org.eclipse.jetty.websocket.common.RemoteEndpointFactory
for every new accepted connection.The graph corresponds to the following lines in
WebSocketSession
. Overriding this behaviour doesn't seem to be easy since a concrete class is created in the session factory.https://github.com/eclipse/jetty.project/blob/67eb9b35311dfd67b149204105a4f980772fa755/jetty-websocket/websocket-common/src/main/java/org/eclipse/jetty/websocket/common/WebSocketSession.java#L171-L172
As far as I can tell from browsing the code, this is not an issue for the
10.x
branch. However, it would be great to resolve it in9.4.x
somehow. As far as I can tell, there are a few options:What do you think? If any of the above sounds good to you, I'll be happy to submit a PR.
The text was updated successfully, but these errors were encountered: