Open sbordet opened 1 year ago
Currently response listeners are modeled as List<Response.ResponseListener>
, but then we always need to extract the content listeners and treat them specially.
So perhaps we need to reify the List
into a proper class, so that we can use it without having to extract the content listeners all the times.
The ResponseNotifier
right now does a lot of instanceof
which I'm not sure they play well with https://bugs.openjdk.org/browse/JDK-8180450 -- these can be avoided if we have a special class to hold listeners separated.
HttpReceiver.responseXYZ()
methods now always create an allocating lambda.
To avoid this, we can create a ResponseBeginTask implements Runnable
class, so that responseBegin()
becomes:
protected void responseBegin(HttpExchange exchange)
{
responseBeginTask.exchange = exchange;
invoker.run(responseBeginTask);
}
And similarly for all other events.
HttpReceiver.DecodingContentSource
and GzipRequest.GzipTransformer
look line-by-line almost identical.
Can we factor them out into jetty-http
?
For Item 1 we should first check out Red Hat's type pollution agent to figure out how badly we're impacted or not.
Item 1 is also about getting rid of the "rewrapping" of listeners that happen in HttpRequest
, which is a bit weird but required, and may save some allocation.
Item 1 has been addressed by #9335.
This issue has been automatically marked as stale because it has been a full year without activity. It will be closed if no further activity occurs. Thank you for your contributions.
Item 2 and Item 3 should be addressed.
Jetty version(s) 12+
Description Umbrella issue for optimizations to be applied to the client library after #8739.