jetty.project
jetty.project copied to clipboard
Http3Fields efficiency
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.
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.
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.
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.