You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shiro.apache.org by "Janne Jalkanen (JIRA)" <ji...@apache.org> on 2010/12/15 13:29:01 UTC

[jira] Created: (SHIRO-226) Default rememberMe cookie size is rather large

Default rememberMe cookie size is rather large
----------------------------------------------

                 Key: SHIRO-226
                 URL: https://issues.apache.org/jira/browse/SHIRO-226
             Project: Shiro
          Issue Type: Improvement
          Components: RememberMe
    Affects Versions: 1.1.0
            Reporter: Janne Jalkanen


The rememberMe cookie size is fairly big since it uses the DefaultSerializer, which serializes a lot of stuff which is not really necessary - especially for the fairly common single realm - single principal case. Please see discussion at http://mail-archives.apache.org/mod_mbox/shiro-user/201012.mbox/%3C2C685FDE-71EE-4834-8816-8E00C890D050@ecyrd.com%3E


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (SHIRO-226) Default rememberMe cookie size is rather large

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SHIRO-226?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Janne Jalkanen updated SHIRO-226:
---------------------------------

    Attachment: SHIRO-226-jalkanen-1.patch

The included patch proposes a SimplePrincipalSerializer, which provides significant size benefits without (hopefully) sacrificing genericity.

The results are as follows (can be replicated by running the included test case).

{noformat}
Single principal, single realm
Default serializer, Simple serializer, Size saving
               421                100       76.25%

Multiple principals, single realm
Default serializer, Simple serializer, Size saving
               575                254       55.83%

Multiple principals, multiple realms
Default serializer, Simple serializer, Size saving
               815                368       54.85%
{noformat}

> Default rememberMe cookie size is rather large
> ----------------------------------------------
>
>                 Key: SHIRO-226
>                 URL: https://issues.apache.org/jira/browse/SHIRO-226
>             Project: Shiro
>          Issue Type: Improvement
>          Components: RememberMe
>    Affects Versions: 1.1.0
>            Reporter: Janne Jalkanen
>         Attachments: SHIRO-226-jalkanen-1.patch
>
>
> The rememberMe cookie size is fairly big since it uses the DefaultSerializer, which serializes a lot of stuff which is not really necessary - especially for the fairly common single realm - single principal case. Please see discussion at http://mail-archives.apache.org/mod_mbox/shiro-user/201012.mbox/%3C2C685FDE-71EE-4834-8816-8E00C890D050@ecyrd.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHIRO-226) Default rememberMe cookie size is rather large

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHIRO-226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971671#action_12971671 ] 

Janne Jalkanen commented on SHIRO-226:
--------------------------------------

Yup, I specifically did not wish to mess with DefaultSerializer because changing it would mean breaking everyone's rememberMe -cookies - and because there might be other uses for DefaultSerializer as well. I'm leaving the overall impact analysis to you guys :-)

> Default rememberMe cookie size is rather large
> ----------------------------------------------
>
>                 Key: SHIRO-226
>                 URL: https://issues.apache.org/jira/browse/SHIRO-226
>             Project: Shiro
>          Issue Type: Improvement
>          Components: RememberMe
>    Affects Versions: 1.1.0
>            Reporter: Janne Jalkanen
>         Attachments: SHIRO-226-jalkanen-1.patch
>
>
> The rememberMe cookie size is fairly big since it uses the DefaultSerializer, which serializes a lot of stuff which is not really necessary - especially for the fairly common single realm - single principal case. Please see discussion at http://mail-archives.apache.org/mod_mbox/shiro-user/201012.mbox/%3C2C685FDE-71EE-4834-8816-8E00C890D050@ecyrd.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHIRO-226) Default rememberMe cookie size is rather large

Posted by "Janne Jalkanen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHIRO-226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971663#action_12971663 ] 

Janne Jalkanen commented on SHIRO-226:
--------------------------------------

Oops, patch is against r1049525, i.e. current trunk.

> Default rememberMe cookie size is rather large
> ----------------------------------------------
>
>                 Key: SHIRO-226
>                 URL: https://issues.apache.org/jira/browse/SHIRO-226
>             Project: Shiro
>          Issue Type: Improvement
>          Components: RememberMe
>    Affects Versions: 1.1.0
>            Reporter: Janne Jalkanen
>         Attachments: SHIRO-226-jalkanen-1.patch
>
>
> The rememberMe cookie size is fairly big since it uses the DefaultSerializer, which serializes a lot of stuff which is not really necessary - especially for the fairly common single realm - single principal case. Please see discussion at http://mail-archives.apache.org/mod_mbox/shiro-user/201012.mbox/%3C2C685FDE-71EE-4834-8816-8E00C890D050@ecyrd.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHIRO-226) Default rememberMe cookie size is rather large

Posted by "Kalle Korhonen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHIRO-226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971668#action_12971668 ] 

Kalle Korhonen commented on SHIRO-226:
--------------------------------------

Thanks Janne! As is, the patch provides an alternative to the DefaultSerializer, thereby rolling the responsibility of using it (and first finding out a problem and solution exists!) to the users which is not ideal. But perhaps we shouldn't worry about that as part of this issue; the patch itself looks good and I don't have any objections to including it.

> Default rememberMe cookie size is rather large
> ----------------------------------------------
>
>                 Key: SHIRO-226
>                 URL: https://issues.apache.org/jira/browse/SHIRO-226
>             Project: Shiro
>          Issue Type: Improvement
>          Components: RememberMe
>    Affects Versions: 1.1.0
>            Reporter: Janne Jalkanen
>         Attachments: SHIRO-226-jalkanen-1.patch
>
>
> The rememberMe cookie size is fairly big since it uses the DefaultSerializer, which serializes a lot of stuff which is not really necessary - especially for the fairly common single realm - single principal case. Please see discussion at http://mail-archives.apache.org/mod_mbox/shiro-user/201012.mbox/%3C2C685FDE-71EE-4834-8816-8E00C890D050@ecyrd.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHIRO-226) Default rememberMe cookie size is rather large

Posted by "Les Hazlewood (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHIRO-226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971755#action_12971755 ] 

Les Hazlewood commented on SHIRO-226:
-------------------------------------

Hi Janne,

This is good - thanks very much for the patch!

Before we resolve this issue though, I think the default SimplePrincipalCollection should contain this logic as well - there are times when principals are serialized outside the context of 'rememberMe' (e.g when caching), and those usages should benefit from this as well.

Also, this would further reduce the need for users to manually specify the SimplePrincipalSerializer, since the size savings between it and the default serialization approach should be very small (the difference being the number of bytes taken up by the MAGIC constant vs the class name included by the JDK).

I'll implement those changes in SimplePrincipalCollection, create some more tests for it, and update this issue when I'm done.

> Default rememberMe cookie size is rather large
> ----------------------------------------------
>
>                 Key: SHIRO-226
>                 URL: https://issues.apache.org/jira/browse/SHIRO-226
>             Project: Shiro
>          Issue Type: Improvement
>          Components: RememberMe
>    Affects Versions: 1.1.0
>            Reporter: Janne Jalkanen
>         Attachments: SHIRO-226-jalkanen-1.patch
>
>
> The rememberMe cookie size is fairly big since it uses the DefaultSerializer, which serializes a lot of stuff which is not really necessary - especially for the fairly common single realm - single principal case. Please see discussion at http://mail-archives.apache.org/mod_mbox/shiro-user/201012.mbox/%3C2C685FDE-71EE-4834-8816-8E00C890D050@ecyrd.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (SHIRO-226) Default rememberMe cookie size is rather large

Posted by "Les Hazlewood (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SHIRO-226?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12971757#action_12971757 ] 

Les Hazlewood commented on SHIRO-226:
-------------------------------------

I just thought of something as well - we can try to use a Zip stream to compress the output even more.  I'll try that in some of our tests and see what happens w/ regards to time vs space.

> Default rememberMe cookie size is rather large
> ----------------------------------------------
>
>                 Key: SHIRO-226
>                 URL: https://issues.apache.org/jira/browse/SHIRO-226
>             Project: Shiro
>          Issue Type: Improvement
>          Components: RememberMe
>    Affects Versions: 1.1.0
>            Reporter: Janne Jalkanen
>         Attachments: SHIRO-226-jalkanen-1.patch
>
>
> The rememberMe cookie size is fairly big since it uses the DefaultSerializer, which serializes a lot of stuff which is not really necessary - especially for the fairly common single realm - single principal case. Please see discussion at http://mail-archives.apache.org/mod_mbox/shiro-user/201012.mbox/%3C2C685FDE-71EE-4834-8816-8E00C890D050@ecyrd.com%3E

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.