You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by "Maria Fedotova (JIRA)" <ji...@apache.org> on 2015/05/15 07:33:00 UTC

[jira] [Comment Edited] (TAP5-2478) Create getIfExists in SessionApplicationStatePersistenceStrategy

    [ https://issues.apache.org/jira/browse/TAP5-2478?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14543765#comment-14543765 ] 

Maria Fedotova edited comment on TAP5-2478 at 5/15/15 5:32 AM:
---------------------------------------------------------------

There're changes for tapestry-hibernate and tapestry-jpa projects in [^TAP-2478_add.patch], but I am not sure about these change because we don't use them.


was (Author: m.fedotova):
There're changes for tapestry-hibernate and tapestry-jpa projects in [^TAP-2478_add.patch], but I am not sure about these change because we don't use them.

> Create getIfExists in SessionApplicationStatePersistenceStrategy
> ----------------------------------------------------------------
>
>                 Key: TAP5-2478
>                 URL: https://issues.apache.org/jira/browse/TAP5-2478
>             Project: Tapestry 5
>          Issue Type: Improvement
>            Reporter: Maria Fedotova
>              Labels: patch, perfomance
>         Attachments: TAP5-2478.patch, TAP5-2478_add.patch
>
>
> Instead of this code
> {code}
> public <T> T getIfExists(Class<T> ssoClass)
>     {
>         ApplicationStateAdapter<T> adapter = getAdapter(ssoClass);
>         return adapter.exists() ? adapter.getOrCreate() : null;
>     }
> {code}
> I've create function getIfExists
> {code}
>     public <T> T getIfExists(Class<T> ssoClass)
>     {
>         return getAdapter(ssoClass).getIfExists();
>     }
> {code}
> This patch incresed requests per second on ~7% (from 24 to 26)
> Thank [~mihasik] for the idea.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)