hhvm artisan commands on laravel lumen is slow

1000 views Asked by At

Did anyone recognize that artisan for Lumen or Laravel is slow?

I want to write my own artisan command and run it like this:

hhvm artisan my:command --myparam=true

Even hhvm artisan needs 2 seconds to show the list of available commands.

If I run it like this hhvm -v Eval.Jit=false artisan it is like standard php, but I want to have my own commands and use the JIT to kick in for long running scripts.

I'm using hhvm 3.7.2 on Ubuntu 14.04.

Is there anything to set in the ini files or another configuration for Laravel/Lumen to use JIT for CLI?

1

There are 1 answers

1
Josh Watzman On

HHVM does indeed have a much longer startup time than PHP5 does, so something that just prints out a list of available commands (i.e., does no real work) is going to be a lot slower on HHVM. You'll be paying the larger startup cost without actually running enough code to take advantage of the JIT speedup!

Is this startup cost what you're perceiving as slowness? How long do some of the longer-running commands run? (I don't know much about artisan.) If they aren't very long-running, you may indeed be better off disabling the JIT -- along with the aforementioned startup cost, the JIT itself also has some warmup cost as it generates optimized code.

If the artisan commands are long-running, doing real CPU work (as opposed to just database queries), and still slower on HHVM than on PHP5, that would be interesting to look into. There's not a quick answer or magic INI setting here; you should file an issue on GitHub with as much information as possible, and we can help you either get us a repro case or dig into what's going on. GitHub issues are a much better forum for this sort of thing than SO :)