-
Type:
Enhancement
-
Resolution: Fixed
-
Priority:
P4
-
Affects Version/s: 11
-
Component/s: core-libs
-
b19
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
System / OS is irrelevant
Java version: any since 11
A DESCRIPTION OF THE PROBLEM :
HttpHeaders.firstValueAsLong uses mapToLong in combination with Long::valueOf, see https://github.com/openjdk/jdk/blob/master/src/java.net.http/share/classes/java/net/http/HttpHeaders.java#L97C9-L97C16. Since mapToLong accepts a ToLongFunction, this unnecessarily boxes to Long just to auto-unbox again. Replacing Long::valueOf with Long::parseLong would give a (small) performance improvement.
System / OS is irrelevant
Java version: any since 11
A DESCRIPTION OF THE PROBLEM :
HttpHeaders.firstValueAsLong uses mapToLong in combination with Long::valueOf, see https://github.com/openjdk/jdk/blob/master/src/java.net.http/share/classes/java/net/http/HttpHeaders.java#L97C9-L97C16. Since mapToLong accepts a ToLongFunction, this unnecessarily boxes to Long just to auto-unbox again. Replacing Long::valueOf with Long::parseLong would give a (small) performance improvement.
- links to
-
Commit(master)
openjdk/jdk/e1b67709
-
Review(master)
openjdk/jdk/24561