-1

I know different situations call for different uses, but what are the advantages of using HHVM over an Opcache, like APC, for instance?

Robert Dundon
  • 1,081
  • 1
  • 11
  • 22
  • I think you're a little late to the party. HHVM isn't targeting PHP7 and is retiring support for PHP5 soon, they'll be exclusively Hack. APC is a dead caching technology, made obsolete by opcache. – Devon Bessemer Jul 10 '18 at 18:23
  • @Devon Well then. I'll just stick with straight PHP 7 – Robert Dundon Jul 10 '18 at 18:27

1 Answers1

2

Long story short, HHVM is drastically less useful if you are using PHP 7+, and is not particularly useful for a large number of use cases. The more in depth story is that HHVM is a optimized compiler, not a cache. APC/Opcache/Redis/Memcached prevent the programmatic overhead of compiling a subset of information repeatedly that incurs an expensive transaction. The compiler (HHVM) makes the code itself execute faster. You would use HHVM to optimize (PHP 5 and below) execution, and the cache to buffer responses that are fetched externally (MySQL/an API call/ etc) outside of PHP, or from a combination of several calls and internal logic to create an end result. Both have distinct purposes, and can work in parallel depending on your needs. If you are performing a lot of complex logic repeatedly, use a cache. If you have a heavy codebase on PHP 5.x or lower, use HHVM. If you are using PHP 7.x, you can mostly disregard HHVM (do research on your individual use case though).

mopsyd
  • 1,877
  • 3
  • 20
  • 30