Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3778

[perf] cache url and request path for default Resource implementations

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.2.0-beta
    • Component/s: JSR-344
    • Labels:
      None

      Description

      Checking performance of the latest 2.2.x code, I have found that both url and request path for default Resource instances are calculated over and over, but they never change. The reason is you cannot add resources to the path dynamically, which means all resources are static and does not change over application lifetime, so it is safe to store these two values in the cache and reuse them.

      The only side effect detected is if two mappings (prefix and suffix) are used on the same application, the request path for a resource will not be according to the current mapping, but that's ok because one or the other should just the same.

      This will improve performance a bit. The reason is before this patch, each Resource instace requires calculate the url and the request path. This is relevant for composite components, because each composite component requires create 1 Resource instance each time it is instantiated.

        Attachments

          Activity

            People

            • Assignee:
              lu4242 Leonardo Uribe
              Reporter:
              lu4242 Leonardo Uribe
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: