hedii's avatar

Lumen facades perfomance

Is there a performance advantage not to use facades with lumen?

0 likes
3 replies
bobbybouwmann's avatar

Well evert extra you need to make, makes your application slower. So in this case a number of classed needs to be instantiated and so on. However this is not noticeable for the user, as far as I know. It might be a few milliseconds..

hedii's avatar

@bobbybouwmann ok, i want these milliseconds, it's for an api. I coded all my app in lumen without facades, but i am stuck with calling artisan from code without using facades... Simple way would be to enable facades, but if there is at least some milliseconds that i can gain, i prefer not to enable them. Do you have an idea of how to call artisan inside code without the artisan facade?

bobbybouwmann's avatar

Not sure if the path is the same in Lumen, but in Laravel you can do this

$artisan  = new \Illuminate\Foundation\Console\Kernel($this->app);
$artisan->call('your artisan command');

I think this is the best way to go

1 like

Please or to participate in this conversation.