6. Hiphop for PHP, cos'è?
• Trasforma codice sorgente da PHP a C++
• Compilazione tramite GCC
• Reimplementazione completa di PHP
• Non proprio “brand new” (3+)
• Grosso progetto (1 MLOC Vs. 3 MLOC di PHP)
• Beta
• “Fucking FAST!”
7. Subsystems
• Runtime
o PHP types, operations and stuff
• Compiler
o Turn PHP code into C++
• Interpreter/eval
o Run PHP code directly
• Execution models
o Webserver, single execution, libraries
8. Runtime (the basis)
• Complete C++ reimplementation
C
• How to make C++ behave as PHP?
o Heavy operator overloading
o Heavy smart pointers
o Heavy reference counting
• = a nicer way to write core HPHP code and extensions!
10. Execution models
• Single execution
o Specify which "virtual file" to run
• Webserver
o libevent + evhttp based
o thread-pool
o service threads
• Embedded library
o C++, Java, Python
11. Neat stuff
• Upgrade with 0 downtime
o Socket transfer over a unix socket
• Memory manager
o Warm-up document
• Parallelization
o Parallel MySQL queries
• Stat counters
o Admin API
12. Hiphop don't
• (100% - 99% compatible) * size of Hyves = lots of shit
• No if (!class_exists('bla')) hyves_require_once('bla.php');
• create_function is borderline
• eval is borderline
• HIPHOP constant
13. Deploy
• ~ 500 server
•
• Generazione “mainweb”
•
• Testing, testing, testing e... testing
•
• BitTorrent
•
• Attivazione
•
• Go live