HHVM poor performance

寵の児 提交于 2019-11-28 15:35:29
Owen Yamauchi

HHVM engineer here.

In server mode, HHVM will run the first N requests it sees in interpreter-only mode (i.e. with the JIT off).

The default in an optimized build is N=11, so if you were to run the request 12 times, the 12th one would be much faster.

You can tune this with a config option, like so: -v Eval.JitWarmupRequests=3. If you set it to 0, you'll see the speedup immediately.

There are a couple reasons to do this.

First, it prevents transient warmup effects from affecting JIT-compiled code.

For example, the first few requests may need populate values in APC, which will cause the application code to go down different paths from the steady-state paths. This way, we don't waste space on JIT compilations that will only be used a few times.

Second, it allows HHVM to collect profiling information to improve future compilation.

If we observe that a certain value is an integer 99% of the time, for example, we can compile code that's optimized for the integer case. We currently don't have the facility to JIT-compile code with profiling enabled (the hard part is safely throwing it away once we're done with it), so we do the data collection in interpreter-only mode.

I have the same performance problem, and I get impressive results only after commenting these lines in /etc/hhvm/php.ini

;hhvm.log.level = Warning
;hhvm.log.always_log_unhandled_exceptions = true
;hhvm.log.runtime_error_reporting_level = 8191

if HHVM > v3.4 Changed Eval.JitWarmupRequests=0 to Eval.JitProfileInterpRequests=0

`#!/usr/bin/hhvm -v Eval.Jit=1 -v Eval.JitProfileInterpRequests=0  ./do.php`
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!