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

Implement route caching speed improvements #1074

Closed
dunhamjared opened this issue Apr 28, 2020 · 2 comments
Closed

Implement route caching speed improvements #1074

dunhamjared opened this issue Apr 28, 2020 · 2 comments

Comments

@dunhamjared
Copy link
Contributor

dunhamjared commented Apr 28, 2020

From my understanding, the awesome route caching improvements from Laravel has yet to be implemented into the Lumen project.

It would be nice to have this for Lumen as well.

Related: laravel/framework#31188

@dunhamjared
Copy link
Contributor Author

I swapped out FastRoute\simpleDispatcher with FastRoute\cachedDispatcher and ran:

for ($i = 0; $i < 800; $i++) {
    $router->get('/test-'.$i.'/{foo}', 'TestController');
}

...with the following controller:

class TestController extends Controller
{
    public function __invoke($foo)
    {
        return 'Invoked - '.$foo;
    }
}

...and command:

 ab -t 10 -c 1 http://127.0.0.1/test-799/foo

And here are the average requests per second:

image

@driesvints
Copy link
Member

We have no plans to change the router in Lumen.

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

No branches or pull requests

2 participants