laravel / blog-contest-may-mayhem

240 stars 16 forks source link

How to make Laravel faster #9

Closed hhxsv5 closed 6 years ago

hhxsv5 commented 6 years ago

How to make Laravel faster

xiaotianhu commented 6 years ago

Using Laravel+Laravel-s+swoole in production,works fantastic,super fast.

taylorotwell commented 6 years ago

Hmm, did you lobby for votes somewhere? You received quite a few votes within about 4-5 minutes timespan.

Dylan-DPC-zz commented 6 years ago

This book might help image

hhxsv5 commented 6 years ago

Not lobby, I just share this link into my social circle. @taylorotwell

jacurtis commented 6 years ago

There were only 5 rules... image

hhxsv5 commented 6 years ago

sorry for this, I will open new issue.

hkp22 commented 6 years ago

@taylorotwell I have read many articles which tells that Swoole makes php projects faster. I have tried swooletw/laravel-swoole package with laravel. But I don't know why it had not worked for me. So, I believe laravel should have officially support for Swoole.

SadeghPM commented 6 years ago

@hkp22 there's many aspect/issue in async/swool. for example consider following snippet from laravel source code:

if (! is_null($this->user)) {
    return $this->user;
}

its look like pretty normal but in async/swool its fatal problem! Although these problems solved in swooletw/laravel-swoole package, but many laravel packages dosn't work by default because of above issue. Other problems like Global var and static also exists. in brief, there's a lot of work to compatible laravel ecosystem with async/swool . and I think it's unlikely that this will happen. more info at laravel-swoole Q&A

hhxsv5 commented 6 years ago

@SadeghPM @hkp22 Swoole is the server of resident memory type, different from Nginx+PHP-FPM. This feature makes Laravel faster, but another problem, need programmer to maintain the global/singleton/static variables about request context.