Inefficient String.replace in PathFileObject.toBinaryName

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Unresolved
    • Priority: P4
    • tbd
    • Affects Version/s: None
    • Component/s: 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.

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

              Created:
              Updated: