Uploaded image for project: 'MyFaces Trinidad'
  1. MyFaces Trinidad
  2. TRINIDAD-906

optimize getClientId - use per thread shared StringBuilder

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.2.5-core
    • 1.0.6-core, 1.2.6-core
    • None
    • None

    Description

      In getClientId/getContainerClientId we create a new stringBuilder.

      However when creating a client id we only use one stringBuilder at a time, so have a single instance of a StringBuilder saved on thread local.

      Have a utility to get this instance, and any time a user gets the instance, set the length of the stringBuilder to 0. This will completely break if a user tries to call it for 2 stringbuilders, so doc this well.

      Preliminary testing by a performance person here at Oracle found "the saving is ~300KB out of 5850KB for the request. This is about 5% total request memory. As expected profile shows that most of the memory saving comes from not creating huge number of string builders"

      Attachments

        Activity

          People

            gabrielle Gabrielle Crawford
            gabrielle Gabrielle Crawford
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: