Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-2478

Create getIfExists in SessionApplicationStatePersistenceStrategy

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5.0
    • Component/s: None
    • Labels:

      Description

      Instead of this code

      public <T> T getIfExists(Class<T> ssoClass)
          {
              ApplicationStateAdapter<T> adapter = getAdapter(ssoClass);
      
              return adapter.exists() ? adapter.getOrCreate() : null;
          }
      

      I've create function getIfExists

          public <T> T getIfExists(Class<T> ssoClass)
          {
      
              return getAdapter(ssoClass).getIfExists();
          }
      

      This patch increased requests per second on ~7% (from 24 to 26 on huge pages)
      Thank Michael Mikhulya for the idea.

        Attachments

        1. TAP5-2478.patch
          4 kB
          Maria Fedotova
        2. TAP5-2478_add.patch
          3 kB
          Maria Fedotova
        3. 0001-TAP5-2478-short-circuit-in-getIfExists-if-there-is-n.patch
          6 kB
          Jochen Kemnade

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              m.fedotova Maria Fedotova
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: