Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8222806

Inefficient String.replace in PathFileObject.toBinaryName

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • tools

      PathFileObject.toBinaryName() uses String.replace(String, String), which is profiling at 3x the cost of String.replace(char, char) on my machine. Switching to use the primitive version where possible saves ~300ms in a 30s compilation, or about 1%.

      FileSystem.getSeperator() isn't guaranteed to return a single-character separator, but a simple check can satisfy all cases while still being optimal for single-character separators.

            ronsh Ron Shapiro
            ronsh Ron Shapiro
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: