Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[spiral/router] Improve performance on bootstrap #942

Open
butschster opened this issue May 17, 2023 · 0 comments
Open

[spiral/router] Improve performance on bootstrap #942

butschster opened this issue May 17, 2023 · 0 comments
Labels
Component: Router Help wanted Contributors, your turn to help us! Rethink
Milestone

Comments

@butschster
Copy link
Member

Description

There are two place where we check route uri handler using try/catch

try {
    $uriHandler = $route->getUriHandler();
} catch (\Throwable) {
    $uriHandler = $this->uriHandler;
}

https://github.com/spiral/framework/blob/master/src/Router/src/RouteGroup.php#L106
https://github.com/spiral/framework/blob/master/src/Router/src/Router.php#L207

But using try catch my be slower that using proper method like $route->hasUriHandler()

@butschster butschster added Rethink Component: Router Help wanted Contributors, your turn to help us! labels May 17, 2023
@butschster butschster added this to the 4.0 milestone May 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Router Help wanted Contributors, your turn to help us! Rethink
Projects
Status: Todo
Development

No branches or pull requests

1 participant