This document discusses HHVM, the Hip Hop Virtual Machine developed by Facebook as a runtime for PHP that aims to be faster than traditional PHP interpreters. It provides an overview of what HHVM is, a brief history, compatibility information, how it works by compiling code to bytecode using a just-in-time compiler, installation instructions for Debian/Ubuntu, Mac OS X and Windows, and introduces the Hack programming language that can be used with HHVM.
2. SOBRE MIM
DEVELOPER POR AMOR HA MAIS DE 5 ANOS
ZEND CERTIFIED ENGINEER DESDE 2013
APAIXONADO POR TECNOLOGIA
3. HHVM - O QUE EH ?
HHVM - HIP HOP VIRTUAL MACHINE
ESCRITA PELO FACEBOOK
DESENVOLVIDA EM C++, PHP E OCALM
POSSUI UMA LINGUAGEM OPICIONAL CHAMADA
“HACK”
OBJETIVO: SER MUITO MAIS RAPIDA QUE O “ZEND”
PHP E SER COMPATIVEL COM ELE
4. UM POUCO DE HISTORIA!!
2008 - HPHPc , HPHPi, HPHPd
2010 - HHVM - Suporte a PHP 5.4
2013 - HPHPc DEPRECIADO
5. COMPATIBILIDADE
UNIX BASED OS
(SE VOCE PREFERE WINDOWS, USE O VAGRANT)
NGINX e APACHE
PHP 5.4
LIBRARIES: COMPOSER, DOCTRINE, MONOLOG,
TWIG, GUZZLE, REACTPHP, PHPUNIT.
FRAMEWORKS: SYMFONY, DRUPAL, CODEIGINITER,
CAKEPHP, LARAVEL, SILEX, SLIM, ETC.
10. ALGUNS GRAFICOS QUE
IRÃO TE CONVENCER
REQUISIÇÕES POR MINUTO
(REQUISIÇÕES DE RÁPIDA RESPOSTA)
REQUISIÇÕES POR MINUTO
(REQUISIÇÕES DE LONGA RESPOSTA)
11. NÃO SURPREENDIDO?
TEMPO DE RESPOSTA EM MS
(REQUISIÇÃO DE RÁPIDA RESPOSTA)
TEMPO DE RESPOSTA EM MS
(REQUISIÇÃO DE LONGA DURAÇÃO)
12. INSTALAÇÃO - DEBIAN BASED
deb http://dl.hhvm.com/ubuntu saucy main !
apt-get update!
apt-get install hhvm!
/etc/init.d/hhvm start!
#no config do nginx!
location ~ .php$ {!
fastcgi_index index.php;!
fastcgi_keep_conn on;!
include /etc/nginx/fastcgi_params;!
fastcgi_pass 127.0.0.1:9000;!
fastcgi_param SCRIPT_FILENAME !
$document_root$fastcgi_script_name;!
}
13. INTALAÇÃO - Mac OS X
brew tap homebrew/dupes !
brew tap homebrew/versions!
brew tap mcuadros/homebrew-hhvm!
brew install hhvm !
#no config do nginx!
location ~ .php$ {!
fastcgi_index index.php;!
fastcgi_keep_conn on;!
include /etc/nginx/fastcgi_params;!
fastcgi_pass 127.0.0.1:9000;!
fastcgi_param SCRIPT_FILENAME !
$document_root$fastcgi_script_name;!
}