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

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

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.2.0-beta
    • JSR-344
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: