Api: Route Cache, much slower than without

Created on 20 Mar 2016  路  11Comments  路  Source: dingo/api

So this is really odd. I've got 168 controllers, most with 5 routes for index, show, store, update, and destroy. I don't use route as I don't want to pay the price for reflection so I have ~680 routes specified in routes, all under dingo ($api). The issue is with the route cache the times via postman are at least 30% slower than without the route cache and this performance is consistent with homestead and AWS/forge.

Any ideas what is going on? The config cache delivers a modest performance improvement, as expected. I traded email with Taylor Otwell and he's never seen this, he always sees a big performance gain from using the route cache.

Most helpful comment

Bump

All 11 comments

I'll take a look, see what I can find.

Thanks.

Any news? Does anyone else have similar behavior with the route cache?

Haven't had a chance to replicate this yet, been a little busy with other areas.

Has anyone else experienced this problem?

Bump

Same problem here.

A simple API request which should complete fairly quickly takes up about 45% of the time in Dingo\Api\Routing\Router::getRoutes() according to Blackfire.

Can confirm the issue. In my case all requests with api:cache are about 500ms slower. Would really love to use route cache in production. Unserialize in app('api.router')->setAdapterRoutes(unserialize(base64_decode())); call takes its toll, dont know why yet

Edit: igbinary does not make much of a difference either. For reference I have close to 300 routes

Bump

@jasonlewis The same issue for me! :(

I'm aware of the issue @mxkh, unfortunately I think the best solution for this is a complete re-write were we're back to using Laravel's router.

Needless to say this will not happen quickly, but I want to accomplish this maybe within ~6 months, so don't worry it will be addressed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MicroDroid picture MicroDroid  路  3Comments

Kirtsen picture Kirtsen  路  3Comments

Sogl picture Sogl  路  4Comments

HTMHell picture HTMHell  路  4Comments

pongz79 picture pongz79  路  4Comments