Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-6824

Use concatenation instead of String.format for frequently called methods

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 9.0.0
    • 9.1.0, 8.10.0
    • wicket-core
    • None

    Description

      Two usages of String.format frequently show up in my production profiler:

      Both methods are potentially called dozens or even hundreds of times for large pages.

      String.format has horrible performance and should mostly be used for generating error messages and debug information. For a detailed analysis see: https://redfin.engineering/java-string-concatenation-which-way-is-best-8f590a7d22a8

      We should replace String.format with simple concatenation in both instances.

      Attachments

        1. image-2020-08-30-20-34-57-261.png
          96 kB
          Thomas Heigl
        2. image-2020-08-30-20-35-04-970.png
          74 kB
          Thomas Heigl

        Activity

          People

            thomas.heigl Thomas Heigl
            thomas.heigl Thomas Heigl
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: