shiro-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Demers (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (SHIRO-455) Allowing to cache WildcardPermission in WildcardPermissionResolver class
Date Thu, 23 Jun 2016 23:12:16 GMT

     [ https://issues.apache.org/jira/browse/SHIRO-455?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Brian Demers updated SHIRO-455:
-------------------------------
    Summary: Allowing to cache WildcardPermission in WildcardPermissionResolver class  (was:
Allowing to cache WildcarPermission in WildcardPermissionResolver class)

> Allowing to cache WildcardPermission in WildcardPermissionResolver class
> ------------------------------------------------------------------------
>
>                 Key: SHIRO-455
>                 URL: https://issues.apache.org/jira/browse/SHIRO-455
>             Project: Shiro
>          Issue Type: Improvement
>          Components: Authorization (access control) , Caching 
>    Affects Versions: 1.2.1, 1.2.2
>            Reporter: Thibault Tigeon
>              Labels: features, patch
>         Attachments: shiro-core.patch
>
>
> Hello,
> I am benching Shiro, tahnks this method:
>     public void bench() {
>         final Subject subject = SecurityUtils.getSubject();
> 	subject.login(new UsernamePasswordToken(LOGIN+i, PWD));
> 	for (int ind = 0; ind < 100000; ind++) { // a lot of authorizations
> 	    assertTrue(subject.isPermitted("medias:album:read"));
> 	}
> 	subject.logout();
>     }
> I see that I waste my time in the methode WildCardPermissionResolver which create a new
instance of permission each time even if it is the same String in parameter.
> I added a map which allows to cache WildcardPermission.
> You can find in attachement the patch.
> PS : the cache for authorisation is activated:
> cacheManager = org.apache.shiro.cache.MemoryConstrainedCacheManager
> securityManager.cacheManager = $cacheManager
> Regards,
> Thibault



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

Mime
View raw message