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

Create getIfExists in SessionApplicationStatePersistenceStrategy

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.5.0
    • None

    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 mihasik for the idea.

      Attachments

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

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: