> This change fixes a performance regression caused by passing instances of 
> `com.sun.tools.javac.util.Name` to a `html.markup.Text` object, where their 
> content is accessed using`CharSequence` methods which are implemented very 
> inefficiently. 
> 
> Since improving `javac.util.Name` will likely require a bit more work (see 
> JDK-8268622), a safe short term solution for JDK 17 is to make sure instances 
> of `Name` are converted to `String` before invoking said `CharSequence` 
> methods. The main fix is to convert to `String` early in 
> `Entity.escapeHtmlChars(CharSequence)` which is invoked by the `Text` 
> constructor. There are a few more `.toString()` invocations added in places 
> where a `Name` is appended to a `StringBuilder`, although these have less 
> performance impact.

Hannes Wallnöfer has updated the pull request incrementally with one additional 
commit since the last revision:

  JDK-8268557: Update year in copyright header

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

Changes:
  - all: https://git.openjdk.java.net/jdk17/pull/42/files
  - new: https://git.openjdk.java.net/jdk17/pull/42/files/f6c876e4..9e051e07

Webrevs:
 - full: https://webrevs.openjdk.java.net/?repo=jdk17&pr=42&range=01
 - incr: https://webrevs.openjdk.java.net/?repo=jdk17&pr=42&range=00-01

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.java.net/jdk17/pull/42.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk17 pull/42/head:pull/42

PR: https://git.openjdk.java.net/jdk17/pull/42

Reply via email to