Skip to content
This repository has been archived by the owner on May 14, 2018. It is now read-only.

bad performance ! :| #152

Closed
sinamiandashti opened this issue Jun 8, 2013 · 6 comments
Closed

bad performance ! :| #152

sinamiandashti opened this issue Jun 8, 2013 · 6 comments
Labels
Milestone

Comments

@sinamiandashti
Copy link

'guards' => array(
            'BjyAuthorize\Guard\Route' => array(
                array('route' => 'admin', 'roles' => array('administrator')),
                )

            )

With this code execution time : 1.41 s
Without this code execution time : 252 ms

why ! ???
why checking route against route guards takes a lot of memory/time ?

@Ocramius
Copy link
Contributor

Ocramius commented Jun 8, 2013

Please trace it first.
On 8 Jun 2013 15:34, "sina miandashti" [email protected] wrote:

'guards' => array(
'BjyAuthorize\Guard\Route' => array(
array('route' => 'admin', 'roles' => array('administrator')),
)

    )

With this code execution time : 1.41 s
Without this code execution time : 252 ms

why ! ???

why checking route against route guards takes a lot of memory/time ?


Reply to this email directly or view it on GitHubhttps://github.com//issues/152
.

@sinamiandashti
Copy link
Author

caused by this code :

 $service    = $this->serviceLocator->get('BjyAuthorize\Service\Authorize');
if ($service->isAllowed('route/' . $routeName)) {
            return;
}

@sinamiandashti
Copy link
Author

more in depth trace exactly caused by this code :
File vendor\bjyoungblood\bjy-authorize\src\BjyAuthorize\Service\Authorize.php
line 232

$this->loaded && $this->loaded->__invoke();

@Ocramius
Copy link
Contributor

Ocramius commented Jun 9, 2013

@placebo yes, that may be it since it may need to load the identity provider and then populate the ACL object: is performance really that bad when you enable it? How many routes do you have in your app? Eventually, consider finishing up #145

@sinamiandashti
Copy link
Author

it was about doctrine role provider

this code is caused that high response time :

        $result = $this->objectRepository->findAll();

File vendor\bjyoungblood\bjy-authorize\src\BjyAuthorize\Provider\Role\ObjectRepositoryProvider.php Line 41

@sinamiandashti
Copy link
Author

why bjyauthorize wont cache the roles ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants