Uploaded image for project: 'XalanJ2'
  1. XalanJ2
  2. XALANJ-2581

Minor performance improvement: Use String.lastIndexOf(int) instead of String.lastIndexOf(String).

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.7.1
    • Fix Version/s: 2.7.2
    • Component/s: None
    • Security Level: No security risk; visible to anyone (Ordinary problems in Xalan projects. Anybody can view the issue.)
    • Labels:
      None

      Description

      Minor performance improvement:

      • Use String.lastIndexOf(int) instead of String.lastIndexOf(String).
      • Use the char version of StringBuffer.append() and String.indexOf().
      • Make ObjectFactory classes final.
      • Eliminate call to inefficient String(String) constructor.
      • Eliminate creation of temporary strings in loops.
      • Iterate over the entries a the map instead of the keys. This avoids a redundant table lookup for each value.
      • String.length() == 0 tends to be slightly faster than String.equals("").
      • Eliminate creation of temporary Boolean objects.

        Attachments

          Activity

            People

            • Assignee:
              shathaway Steven J. Hathaway
              Reporter:
              garydgregory Gary Gregory
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: