com.sun.net.httpserver.Headers issues & optimizations
Robert Engels
rengels at ix.netcom.com
Wed Jan 8 14:03:27 UTC 2025
Thanks Jaikiran. I will submit a PR.
What about the two other related issues - the ability to use a different map implementation (or at least null) and removing the dependency on the Sun internal class?
I have already signed the OCA for previous work.
Robert
> On Jan 8, 2025, at 12:30 AM, Jaikiran Pai <jai.forums2013 at gmail.com> wrote:
>
> Hello Robert,
>
>> On 07/01/25 12:05 am, robert engels wrote:
>> ...
>> With a high performance http server, often the most expensive element is the encoding/decoding/processing of the “headers” when accessing cached resources, etc. Garbage generation can be a real problem for low-latency high volume servers. Since the headers survive for the duration of the request, the are subject to not being quickly cleaned in the new generation.
>>
>> A couple of proposals:
>>
>> 1. The first is to change the implementation of ’normalize’ in Headers. Currently, the cost is paid on every put and every get - even if the developer is aware of the ’normalized’ format and uses that, e.g. getFirst(“Content-length”)
>> ...
>
> The normalize() is an internal implementation detail of the Header class and I think the proposal to improve the performance of that method seems reasonable. I haven't looked closely at your proposed implementation change, but looking at the current implementation in mainline, I think there's scope for improvement. I've created https://bugs.openjdk.org/browse/JDK-8347167 to track this. If you have already spent time improving this method and would like to propose that change to the JDK, then after signing the OCA, you can open a PR linking against this JDK issue (https://openjdk.org/guide/#working-with-pull-requests).
>
> -Jaikiran
>
More information about the net-dev
mailing list