[jdk21u-dev] RFR: 8353013: java.net.URI.create(String) may have low performance to scan the host/domain name from URI string when the hostname starts with number

Rui Li duke at openjdk.org
Wed May 14 18:23:03 UTC 2025


On Wed, 14 May 2025 00:34:49 GMT, Rui Li <duke at openjdk.org> wrote:

> Backport of https://github.com/openjdk/jdk/commit/84458ec18ce33295636f7b26b8e3ff25ecb349f2. [JDK-8353013](https://bugs.openjdk.org/browse/JDK-8353013).
> 
> Clean backport except for copyright header.

Understand performance improvement isn't the main concern of backports. However, exceptions thrown in `URI.create` for URIs like `https://98765432101.ddb.us-east-1.amazonaws.com` have been taking significant CPU cycles in AWS. Some of them can spend over 12% CPU time on `Throwable.fillInStackTrace` caused by `URI.create`. The same issue might significantly impact other applications as well. 

Considering 21 is still the latest LTS, I'm backporting this commit.

-------------

PR Comment: https://git.openjdk.org/jdk21u-dev/pull/1776#issuecomment-2881132330


More information about the jdk-updates-dev mailing list