jetty.project icon indicating copy to clipboard operation
jetty.project copied to clipboard

Http3Fields efficiency

Open gregw opened this issue 2 years ago • 1 comments
trafficstars

Jetty version(s) 12

Enhancement Description

The Http3Fields class is extremely inefficient and about to become more so with #10340. Specifically, the size(), iterator() and listIterator() methods are based on stream() which on every call filters and concatenates the HttpField lists. Sometimes it is double concatenated. It is unclear why this is done? Perhaps simply to maintain ordering of pseudo headers before other headers and to remove ignored headers. The asImmutable() method also does a stream and array copy, even though the original is already immutable?

If would be far better to maintain build the definitive header list once and only once.

gregw avatar Aug 21 '23 23:08 gregw

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.

github-actions[bot] avatar Aug 21 '24 00:08 github-actions[bot]

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.

github-actions[bot] avatar Aug 27 '25 00:08 github-actions[bot]

The Http3Fields is an internal class is used only during QpackEncoder#encode to translate a MetaData to into HttpFields which can be encoded by the QpackEncoder.

It is created and then iterated over only once before it is thrown away.

lachlan-roberts avatar Aug 27 '25 02:08 lachlan-roberts