SlideShare una empresa de Scribd logo
1 de 28
Magento on 
HHVM 
Speeding up your webshop with a drop-in PHP 
replacement.
Daniel Sloof 
https://twitter.com/daniel_sloof 
https://github.com/danslo 
dsloof@engineyard.com
Some background 
Specification 
Ruby Language 
JRuby Rubinius IronRuby 
Java Language 
Oracle Harmony Dalvik 
Implementation 
Sensible Language Design 
Zend PHP 
PHP Language 
Zend PHP HHVM 
PHP
What is HHVM? 
● HipHop Virtual Machine 
● Created by engineers at Facebook 
● Essentially a reimplementation of PHP 
● Originally translated PHP to C++, now 
translates PHP to bytecode 
● Just-in-time compiler, turning generated 
bytecode into machine code 
● In some cases 5 to 10 times faster than 
regular PHP
Bytecode compilation 
● PHP5 style bytecode Yes 
Modified? Invalidate cache 
Compile to 
Bytecode 
Run Bytecode 
No 
execution 
● APC-like caching of 
bytecode 
● Performance is quite 
similar to Zend PHP
Just In Time Compiler 
Modified? 
Have 
Native? 
Hot? 
Invalidate Cache 
Compile to 
Bytecode 
Compile to Native Run Bytecode 
Run Native 
No 
No 
Yes 
Yes 
Yes No
What was the problem? 
● HHVM not entirely compatible with PHP 
● Magento’s PHP triggering many of these 
incompatibilities 
● Choosing between 
○ Forking Magento to work around HHVM 
○ Fixing issues within the extensive HHVM C++ 
codebase
Resulted in... fixing HHVM 
● Already over 100 commits fixing Magento 
related HHVM bugs; 
○ SimpleXML (majority of bugfixes) 
○ sessions 
○ number_format 
○ __get and __set 
○ many more... 
● All of these patches already merged back 
into the official (github) repository 
● Still actively involved and committed to make 
HHVM a good place for Magento
Resulted in... fixing HHVM 
Activity for the HHVM project on github in June 
“Of the top 15 contributors, only 9 are facebook employees.”
Important configuration 
● hhvm.enable_zend_sorting = 1 
○ PHP user sorting “If two members compare as 
equal, their relative order in the sorted array is 
undefined.” 
○ HHVM implements a faster sorting algorithm that 
has a different (undefined) order. 
○ Magento relies on this undefined behavior. 
● hhvm.enable_obj_destruct_call = 1 
○ HHVM by default does not call destructors for 
objects that are alive at the end of the request. 
○ Magento Connect Downloader uses object 
destructors to send output to the browser.
What that means for Magento... 
● Community and Enterprise Editions running 
stable. 
● Passes near 100% of the Test Automation 
Framework. 
● Large boost in improvement. 
● Works with FastCGI, so keep most of your 
current web-configuration, rewrites, etc.
Benchmarks 
Before we go to the results... 
● Magento 1.9 with sample data 
● Standard nginx / php-fpm / percona stack 
(with PHP 5.5 opcode cache) 
● Standard HHVM configuration (repo-authoritative 
mode disabled, JIT enabled) 
● Tool of choice: siege
Benchmarks: Response time 
Average across 50 requests
Benchmarks: Transaction rate 
While increasing siege concurrency until avg. 
response time ~2 seconds
Benchmarks: Other
What about 
<insert caching solution here>? 
● HHVM does not get in the way 
● Dynamic content still needs to be generated 
● Replaces PHP - not Varnish, Redis, FPC, 
Block Cache, etc. 
● As long as you are burning CPU cycles 
(always), you will benefit from HHVM 
● Think about speeding up indexing, order 
placement, routing, etc.
What about PHPNG / PHP7? 
● Better performance than PHP5.5, but still 
trails behind HHVM quite significantly. 
● Not ready. 
http://goo.gl/MyUBeu
How do we know it is stable? 
● Unfortunately there are no unit tests for 
(core) Magento 1.x 
● Brushed up the Test Automation Framework 
● Automated setup of test environment using 
Chef 
● Nightly builds to check Magento compatibility 
on HHVM to make it easier to spot 
regressions
On the topic of debugging 
● HHVM comes with something called HPHPd 
● CLI Based, comparable to GDB 
● No (known) support for any IDEs 
Latest stable release 
has xdebug support!
What is Hack? 
Moving to HHVM gets even more awesome. 
● Statically typed language 
● Type annotations 
● Generics 
● Async 
● Lambda’s 
● Collections 
● Built-in user attributes 
http://hacklang.org/
Hack: Annotating
Hack: 
Constructor Argument Promotion
Hack: Special Attributes
What about the future? 
● Facebook is committed to open source: 
several employees work on it exclusively. 
● HHVM tracks a number of popular 
frameworks and runs their PHPUnit suites 
● Magento 2 is part of that list 
http://hhvm.com/frameworks/
What about the future? 
Open Source Benchmark Suite 
● Automatic installation of popular frameworks 
(Magento, Drupal, Wordpress, etc). 
● Configures your web server 
● Generates reliable performance metrics to 
compare PHP implementations (HHVM, 
PHP7). 
https://github.com/hhvm/oss-performance/
What about the future?
Can we gradually migrate? 
Store not entirely compatible with HHVM and 
still want to run it. 
● Problem is isolated to a (subset of) page(s): 
use web-server configuration to split load. 
● Problem is more widespread (incompatible 
global observers, ioncube, etc): 
https://github.com/danslo/HiphopIndexer/
Thank you! 
Questions?

Más contenido relacionado

La actualidad más candente

CPAN Packager
CPAN PackagerCPAN Packager
CPAN Packager
techmemo
 
Php under the_hood
Php under the_hoodPhp under the_hood
Php under the_hood
frank_neff
 
Hands on performance testing and analysis with web pagetest
Hands on performance testing and analysis with web pagetestHands on performance testing and analysis with web pagetest
Hands on performance testing and analysis with web pagetest
Patrick Meenan
 

La actualidad más candente (20)

It gilde 20150209
It gilde 20150209It gilde 20150209
It gilde 20150209
 
Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper API
 
Enterprise PHP
Enterprise PHPEnterprise PHP
Enterprise PHP
 
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVM
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVMPerformance Comparison of PHP 5.6 vs. 7.0 vs HHVM
Performance Comparison of PHP 5.6 vs. 7.0 vs HHVM
 
CPAN Packager
CPAN PackagerCPAN Packager
CPAN Packager
 
Patterns: The new Javascript framweork
Patterns: The new Javascript framweorkPatterns: The new Javascript framweork
Patterns: The new Javascript framweork
 
Design a scalable site: Problem and solutions
Design a scalable site: Problem and solutionsDesign a scalable site: Problem and solutions
Design a scalable site: Problem and solutions
 
How We Bacame a 'Go' Company
How We Bacame a 'Go' CompanyHow We Bacame a 'Go' Company
How We Bacame a 'Go' Company
 
Last Month in PHP - June 2016
Last Month in PHP - June 2016Last Month in PHP - June 2016
Last Month in PHP - June 2016
 
What the HACK is HHVM?
What the HACK is HHVM?What the HACK is HHVM?
What the HACK is HHVM?
 
Becoming A Php Ninja
Becoming A Php NinjaBecoming A Php Ninja
Becoming A Php Ninja
 
CPAN Packager
CPAN PackagerCPAN Packager
CPAN Packager
 
(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems(phpconftw2012) PHP as a Middleware in Embedded Systems
(phpconftw2012) PHP as a Middleware in Embedded Systems
 
Andrii Shumada "No excuses for not writing tests"
Andrii Shumada "No excuses for not writing tests"Andrii Shumada "No excuses for not writing tests"
Andrii Shumada "No excuses for not writing tests"
 
Php under the_hood
Php under the_hoodPhp under the_hood
Php under the_hood
 
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ... Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
Laravel Poznań Meetup #12 - "Speed up web API with Laravel and Swoole using ...
 
Integração Contínua com PHPCI
Integração Contínua com PHPCIIntegração Contínua com PHPCI
Integração Contínua com PHPCI
 
Hands on performance testing and analysis with web pagetest
Hands on performance testing and analysis with web pagetestHands on performance testing and analysis with web pagetest
Hands on performance testing and analysis with web pagetest
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-step
 

Similar a Daniel Sloof: Magento on HHVM

Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHP
Chau Thanh
 
Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHP
Võ Duy Tuấn
 
zingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphpzingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphp
hazzaz
 
01 zingme practice for building scalable website with php
01 zingme practice for building scalable website with php01 zingme practice for building scalable website with php
01 zingme practice for building scalable website with php
Nguyen Duc Phu
 

Similar a Daniel Sloof: Magento on HHVM (20)

Wc13
Wc13Wc13
Wc13
 
Hhvm vs php
Hhvm vs phpHhvm vs php
Hhvm vs php
 
Подталкиваем PHP к пределу возможностей, Michael Armstrong (lite speed techno...
Подталкиваем PHP к пределу возможностей, Michael Armstrong (lite speed techno...Подталкиваем PHP к пределу возможностей, Michael Armstrong (lite speed techno...
Подталкиваем PHP к пределу возможностей, Michael Armstrong (lite speed techno...
 
Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHP
 
Zingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHPZingme practice for building scalable website with PHP
Zingme practice for building scalable website with PHP
 
zingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphpzingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphp
 
01 zingme practice for building scalable website with php
01 zingme practice for building scalable website with php01 zingme practice for building scalable website with php
01 zingme practice for building scalable website with php
 
Hack and HHVM
Hack and HHVMHack and HHVM
Hack and HHVM
 
Continuous Integration In Php
Continuous Integration In PhpContinuous Integration In Php
Continuous Integration In Php
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application Deployment
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
 
HipHop Virtual Machine
HipHop Virtual MachineHipHop Virtual Machine
HipHop Virtual Machine
 
Evolution of deploy.sh
Evolution of deploy.shEvolution of deploy.sh
Evolution of deploy.sh
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
 
Getting Started with PHP Extensions
Getting Started with PHP ExtensionsGetting Started with PHP Extensions
Getting Started with PHP Extensions
 
Drupal hhvm benchmark
Drupal hhvm benchmarkDrupal hhvm benchmark
Drupal hhvm benchmark
 
Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)Codeception: introduction to php testing (v2 - Aberdeen php)
Codeception: introduction to php testing (v2 - Aberdeen php)
 
Joomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation TestingJoomla Code Quality Control and Automation Testing
Joomla Code Quality Control and Automation Testing
 
How Badoo Saved $1M Switching to PHP7 - Nikolay Krapivnyy - PHPDay Verona 2016
How Badoo Saved $1M Switching to PHP7 - Nikolay Krapivnyy - PHPDay Verona 2016How Badoo Saved $1M Switching to PHP7 - Nikolay Krapivnyy - PHPDay Verona 2016
How Badoo Saved $1M Switching to PHP7 - Nikolay Krapivnyy - PHPDay Verona 2016
 
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
"Building Modern PHP Applications" - Jackson Murtha, South Dakota Code Camp 2012
 

Más de Meet Magento Poland

Fabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOL
Fabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOLFabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOL
Fabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOL
Meet Magento Poland
 
Patrycja Andrzejewska: Responsive checkout - Jak zoptymalizować proces zakup...
Patrycja Andrzejewska: Responsive checkout - Jak zoptymalizować proces zakup...Patrycja Andrzejewska: Responsive checkout - Jak zoptymalizować proces zakup...
Patrycja Andrzejewska: Responsive checkout - Jak zoptymalizować proces zakup...
Meet Magento Poland
 
Mateusz Falkowski: Merchandising w e-commerce. Zarządzanie produktem i pozyc...
Mateusz Falkowski: Merchandising w e-commerce. Zarządzanie produktem i pozyc...Mateusz Falkowski: Merchandising w e-commerce. Zarządzanie produktem i pozyc...
Mateusz Falkowski: Merchandising w e-commerce. Zarządzanie produktem i pozyc...
Meet Magento Poland
 
Fabrizio Balliano: Tracking visitors despite Varnish
Fabrizio Balliano: Tracking visitors despite VarnishFabrizio Balliano: Tracking visitors despite Varnish
Fabrizio Balliano: Tracking visitors despite Varnish
Meet Magento Poland
 
Alex Ursa: ERP Integrations with Magento: How to do it fast, good and affordable
Alex Ursa: ERP Integrations with Magento: How to do it fast, good and affordableAlex Ursa: ERP Integrations with Magento: How to do it fast, good and affordable
Alex Ursa: ERP Integrations with Magento: How to do it fast, good and affordable
Meet Magento Poland
 
Robert Żochowski, Jarosław Gąsiorek: Integracja Magento SAP
Robert Żochowski, Jarosław Gąsiorek: Integracja Magento SAPRobert Żochowski, Jarosław Gąsiorek: Integracja Magento SAP
Robert Żochowski, Jarosław Gąsiorek: Integracja Magento SAP
Meet Magento Poland
 
Maciej Ostrowski: Podstawy implementacji multi-inwentarza w Magento
Maciej Ostrowski: Podstawy implementacji multi-inwentarza w MagentoMaciej Ostrowski: Podstawy implementacji multi-inwentarza w Magento
Maciej Ostrowski: Podstawy implementacji multi-inwentarza w Magento
Meet Magento Poland
 
Andrei Vashkievich: 5 Steps For No-SPAM E-mails in Magento
Andrei Vashkievich: 5 Steps For No-SPAM E-mails in MagentoAndrei Vashkievich: 5 Steps For No-SPAM E-mails in Magento
Andrei Vashkievich: 5 Steps For No-SPAM E-mails in Magento
Meet Magento Poland
 
Mateusz Rzetecki: Redesign serwisu w zgodzie z działaniami SEO - o czym pamię...
Mateusz Rzetecki: Redesign serwisu w zgodzie z działaniami SEO - o czym pamię...Mateusz Rzetecki: Redesign serwisu w zgodzie z działaniami SEO - o czym pamię...
Mateusz Rzetecki: Redesign serwisu w zgodzie z działaniami SEO - o czym pamię...
Meet Magento Poland
 
Maciej Rudnicki: Zautomatyzowane środowisko deweloperskie.
Maciej Rudnicki: Zautomatyzowane środowisko deweloperskie.Maciej Rudnicki: Zautomatyzowane środowisko deweloperskie.
Maciej Rudnicki: Zautomatyzowane środowisko deweloperskie.
Meet Magento Poland
 

Más de Meet Magento Poland (20)

Wiktor Naskręt: Jednorazowa przygoda, przelotna znajomość, 
zżyte małżeństwo...
Wiktor Naskręt: Jednorazowa przygoda, przelotna znajomość, 
zżyte małżeństwo...Wiktor Naskręt: Jednorazowa przygoda, przelotna znajomość, 
zżyte małżeństwo...
Wiktor Naskręt: Jednorazowa przygoda, przelotna znajomość, 
zżyte małżeństwo...
 
Toni Anicic: Conversion Rate Optimization for Magento in the Age of Responsive
Toni Anicic: Conversion Rate Optimization for Magento  in the Age of ResponsiveToni Anicic: Conversion Rate Optimization for Magento  in the Age of Responsive
Toni Anicic: Conversion Rate Optimization for Magento in the Age of Responsive
 
Davide Consonni: Best Practices to Improve Customer Experience and Conversions
Davide Consonni: Best Practices to Improve Customer Experience and ConversionsDavide Consonni: Best Practices to Improve Customer Experience and Conversions
Davide Consonni: Best Practices to Improve Customer Experience and Conversions
 
Eugene Vtorov: Integration of eCommerce and 3D Technologies: see what you buy
Eugene Vtorov: Integration of eCommerce and 3D Technologies: see what you buyEugene Vtorov: Integration of eCommerce and 3D Technologies: see what you buy
Eugene Vtorov: Integration of eCommerce and 3D Technologies: see what you buy
 
Michał Sadowski: Nowoczesne metody promocji marki w sieci
Michał Sadowski: Nowoczesne metody promocji marki w sieciMichał Sadowski: Nowoczesne metody promocji marki w sieci
Michał Sadowski: Nowoczesne metody promocji marki w sieci
 
Paulina Rutecka: Trudni klienci jako choroba przenoszona drogą e-commerce
Paulina Rutecka: Trudni klienci jako choroba przenoszona drogą e-commercePaulina Rutecka: Trudni klienci jako choroba przenoszona drogą e-commerce
Paulina Rutecka: Trudni klienci jako choroba przenoszona drogą e-commerce
 
Krzysztof Wroński: Let’s do this project... together!
Krzysztof Wroński: Let’s do this project... together!Krzysztof Wroński: Let’s do this project... together!
Krzysztof Wroński: Let’s do this project... together!
 
Fabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOL
Fabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOLFabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOL
Fabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOL
 
Patrycja Andrzejewska: Responsive checkout - Jak zoptymalizować proces zakup...
Patrycja Andrzejewska: Responsive checkout - Jak zoptymalizować proces zakup...Patrycja Andrzejewska: Responsive checkout - Jak zoptymalizować proces zakup...
Patrycja Andrzejewska: Responsive checkout - Jak zoptymalizować proces zakup...
 
Mateusz Falkowski: Merchandising w e-commerce. Zarządzanie produktem i pozyc...
Mateusz Falkowski: Merchandising w e-commerce. Zarządzanie produktem i pozyc...Mateusz Falkowski: Merchandising w e-commerce. Zarządzanie produktem i pozyc...
Mateusz Falkowski: Merchandising w e-commerce. Zarządzanie produktem i pozyc...
 
Fabrizio Balliano: Tracking visitors despite Varnish
Fabrizio Balliano: Tracking visitors despite VarnishFabrizio Balliano: Tracking visitors despite Varnish
Fabrizio Balliano: Tracking visitors despite Varnish
 
Alex Ursa: ERP Integrations with Magento: How to do it fast, good and affordable
Alex Ursa: ERP Integrations with Magento: How to do it fast, good and affordableAlex Ursa: ERP Integrations with Magento: How to do it fast, good and affordable
Alex Ursa: ERP Integrations with Magento: How to do it fast, good and affordable
 
Robert Żochowski, Jarosław Gąsiorek: Integracja Magento SAP
Robert Żochowski, Jarosław Gąsiorek: Integracja Magento SAPRobert Żochowski, Jarosław Gąsiorek: Integracja Magento SAP
Robert Żochowski, Jarosław Gąsiorek: Integracja Magento SAP
 
Maciej Ostrowski: Podstawy implementacji multi-inwentarza w Magento
Maciej Ostrowski: Podstawy implementacji multi-inwentarza w MagentoMaciej Ostrowski: Podstawy implementacji multi-inwentarza w Magento
Maciej Ostrowski: Podstawy implementacji multi-inwentarza w Magento
 
Andrei Vashkievich: 5 Steps For No-SPAM E-mails in Magento
Andrei Vashkievich: 5 Steps For No-SPAM E-mails in MagentoAndrei Vashkievich: 5 Steps For No-SPAM E-mails in Magento
Andrei Vashkievich: 5 Steps For No-SPAM E-mails in Magento
 
Mateusz Rzetecki: Redesign serwisu w zgodzie z działaniami SEO - o czym pamię...
Mateusz Rzetecki: Redesign serwisu w zgodzie z działaniami SEO - o czym pamię...Mateusz Rzetecki: Redesign serwisu w zgodzie z działaniami SEO - o czym pamię...
Mateusz Rzetecki: Redesign serwisu w zgodzie z działaniami SEO - o czym pamię...
 
Maciej Rudnicki: Zautomatyzowane środowisko deweloperskie.
Maciej Rudnicki: Zautomatyzowane środowisko deweloperskie.Maciej Rudnicki: Zautomatyzowane środowisko deweloperskie.
Maciej Rudnicki: Zautomatyzowane środowisko deweloperskie.
 
Rytis Lauris: Missed opportunities of automated
cart recovery messages
Rytis Lauris: Missed opportunities of automated
cart recovery messagesRytis Lauris: Missed opportunities of automated
cart recovery messages
Rytis Lauris: Missed opportunities of automated
cart recovery messages
 
Viacheslav Kravchuk: Conversion rate optimisation. What’s really proved to m...
Viacheslav Kravchuk: Conversion rate optimisation.  What’s really proved to m...Viacheslav Kravchuk: Conversion rate optimisation.  What’s really proved to m...
Viacheslav Kravchuk: Conversion rate optimisation. What’s really proved to m...
 
Thomas Goletz: Commerce & growth – why is it important to have a broader view
Thomas Goletz: Commerce & growth – why is it important to have a broader viewThomas Goletz: Commerce & growth – why is it important to have a broader view
Thomas Goletz: Commerce & growth – why is it important to have a broader view
 

Último

Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
amilabibi1
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
Kayode Fayemi
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Hung Le
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
ZurliaSoop
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
David Celestin
 

Último (17)

Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
Bring back lost lover in USA, Canada ,Uk ,Australia ,London Lost Love Spell C...
 
Dreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video TreatmentDreaming Marissa Sánchez Music Video Treatment
Dreaming Marissa Sánchez Music Video Treatment
 
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait Cityin kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
in kuwait௹+918133066128....) @abortion pills for sale in Kuwait City
 
Dreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio IIIDreaming Music Video Treatment _ Project & Portfolio III
Dreaming Music Video Treatment _ Project & Portfolio III
 
My Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle BaileyMy Presentation "In Your Hands" by Halle Bailey
My Presentation "In Your Hands" by Halle Bailey
 
Uncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac FolorunsoUncommon Grace The Autobiography of Isaac Folorunso
Uncommon Grace The Autobiography of Isaac Folorunso
 
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdfAWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
AWS Data Engineer Associate (DEA-C01) Exam Dumps 2024.pdf
 
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven CuriosityUnlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
Unlocking Exploration: Self-Motivated Agents Thrive on Memory-Driven Curiosity
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
ICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdfICT role in 21st century education and it's challenges.pdf
ICT role in 21st century education and it's challenges.pdf
 
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdfSOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
SOLID WASTE MANAGEMENT SYSTEM OF FENI PAURASHAVA, BANGLADESH.pdf
 
Introduction to Artificial intelligence.
Introduction to Artificial intelligence.Introduction to Artificial intelligence.
Introduction to Artificial intelligence.
 
Digital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of DrupalDigital collaboration with Microsoft 365 as extension of Drupal
Digital collaboration with Microsoft 365 as extension of Drupal
 
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
Jual obat aborsi Jakarta 085657271886 Cytote pil telat bulan penggugur kandun...
 
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
Proofreading- Basics to Artificial Intelligence Integration - Presentation:Sl...
 
Zone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptxZone Chairperson Role and Responsibilities New updated.pptx
Zone Chairperson Role and Responsibilities New updated.pptx
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 

Daniel Sloof: Magento on HHVM

  • 1. Magento on HHVM Speeding up your webshop with a drop-in PHP replacement.
  • 2. Daniel Sloof https://twitter.com/daniel_sloof https://github.com/danslo dsloof@engineyard.com
  • 3. Some background Specification Ruby Language JRuby Rubinius IronRuby Java Language Oracle Harmony Dalvik Implementation Sensible Language Design Zend PHP PHP Language Zend PHP HHVM PHP
  • 4. What is HHVM? ● HipHop Virtual Machine ● Created by engineers at Facebook ● Essentially a reimplementation of PHP ● Originally translated PHP to C++, now translates PHP to bytecode ● Just-in-time compiler, turning generated bytecode into machine code ● In some cases 5 to 10 times faster than regular PHP
  • 5. Bytecode compilation ● PHP5 style bytecode Yes Modified? Invalidate cache Compile to Bytecode Run Bytecode No execution ● APC-like caching of bytecode ● Performance is quite similar to Zend PHP
  • 6. Just In Time Compiler Modified? Have Native? Hot? Invalidate Cache Compile to Bytecode Compile to Native Run Bytecode Run Native No No Yes Yes Yes No
  • 7. What was the problem? ● HHVM not entirely compatible with PHP ● Magento’s PHP triggering many of these incompatibilities ● Choosing between ○ Forking Magento to work around HHVM ○ Fixing issues within the extensive HHVM C++ codebase
  • 8. Resulted in... fixing HHVM ● Already over 100 commits fixing Magento related HHVM bugs; ○ SimpleXML (majority of bugfixes) ○ sessions ○ number_format ○ __get and __set ○ many more... ● All of these patches already merged back into the official (github) repository ● Still actively involved and committed to make HHVM a good place for Magento
  • 9. Resulted in... fixing HHVM Activity for the HHVM project on github in June “Of the top 15 contributors, only 9 are facebook employees.”
  • 10. Important configuration ● hhvm.enable_zend_sorting = 1 ○ PHP user sorting “If two members compare as equal, their relative order in the sorted array is undefined.” ○ HHVM implements a faster sorting algorithm that has a different (undefined) order. ○ Magento relies on this undefined behavior. ● hhvm.enable_obj_destruct_call = 1 ○ HHVM by default does not call destructors for objects that are alive at the end of the request. ○ Magento Connect Downloader uses object destructors to send output to the browser.
  • 11. What that means for Magento... ● Community and Enterprise Editions running stable. ● Passes near 100% of the Test Automation Framework. ● Large boost in improvement. ● Works with FastCGI, so keep most of your current web-configuration, rewrites, etc.
  • 12. Benchmarks Before we go to the results... ● Magento 1.9 with sample data ● Standard nginx / php-fpm / percona stack (with PHP 5.5 opcode cache) ● Standard HHVM configuration (repo-authoritative mode disabled, JIT enabled) ● Tool of choice: siege
  • 13. Benchmarks: Response time Average across 50 requests
  • 14. Benchmarks: Transaction rate While increasing siege concurrency until avg. response time ~2 seconds
  • 16. What about <insert caching solution here>? ● HHVM does not get in the way ● Dynamic content still needs to be generated ● Replaces PHP - not Varnish, Redis, FPC, Block Cache, etc. ● As long as you are burning CPU cycles (always), you will benefit from HHVM ● Think about speeding up indexing, order placement, routing, etc.
  • 17. What about PHPNG / PHP7? ● Better performance than PHP5.5, but still trails behind HHVM quite significantly. ● Not ready. http://goo.gl/MyUBeu
  • 18. How do we know it is stable? ● Unfortunately there are no unit tests for (core) Magento 1.x ● Brushed up the Test Automation Framework ● Automated setup of test environment using Chef ● Nightly builds to check Magento compatibility on HHVM to make it easier to spot regressions
  • 19. On the topic of debugging ● HHVM comes with something called HPHPd ● CLI Based, comparable to GDB ● No (known) support for any IDEs Latest stable release has xdebug support!
  • 20. What is Hack? Moving to HHVM gets even more awesome. ● Statically typed language ● Type annotations ● Generics ● Async ● Lambda’s ● Collections ● Built-in user attributes http://hacklang.org/
  • 24. What about the future? ● Facebook is committed to open source: several employees work on it exclusively. ● HHVM tracks a number of popular frameworks and runs their PHPUnit suites ● Magento 2 is part of that list http://hhvm.com/frameworks/
  • 25. What about the future? Open Source Benchmark Suite ● Automatic installation of popular frameworks (Magento, Drupal, Wordpress, etc). ● Configures your web server ● Generates reliable performance metrics to compare PHP implementations (HHVM, PHP7). https://github.com/hhvm/oss-performance/
  • 26. What about the future?
  • 27. Can we gradually migrate? Store not entirely compatible with HHVM and still want to run it. ● Problem is isolated to a (subset of) page(s): use web-server configuration to split load. ● Problem is more widespread (incompatible global observers, ioncube, etc): https://github.com/danslo/HiphopIndexer/