SlideShare a Scribd company logo
1 of 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?

More Related Content

What's hot

Chromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChromium: NaCl and Pepper API
Chromium: NaCl and Pepper APIChang W. Doh
 
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 HHVMJani Tarvainen
 
CPAN Packager
CPAN PackagerCPAN Packager
CPAN Packagertechmemo
 
Patterns: The new Javascript framweork
Patterns: The new Javascript framweorkPatterns: The new Javascript framweork
Patterns: The new Javascript framweorkFranco Pellegrini
 
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 solutionsChau Thanh
 
How We Bacame a 'Go' Company
How We Bacame a 'Go' CompanyHow We Bacame a 'Go' Company
How We Bacame a 'Go' CompanyLuka Napotnik
 
Last Month in PHP - June 2016
Last Month in PHP - June 2016Last Month in PHP - June 2016
Last Month in PHP - June 2016Eric Poe
 
CPAN Packager
CPAN PackagerCPAN Packager
CPAN Packagertechmemo
 
(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 Systemssosorry
 
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"Fwdays
 
Php under the_hood
Php under the_hoodPhp under the_hood
Php under the_hoodfrank_neff
 
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 ...HighSolutions Sp. z o.o.
 
Integração Contínua com PHPCI
Integração Contínua com PHPCIIntegração Contínua com PHPCI
Integração Contínua com PHPCIThiago Paes
 
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 pagetestPatrick Meenan
 
Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Test Driven Development Methodology and Philosophy
Test Driven Development Methodology and Philosophy Vijay Kumbhar
 
Continuous Integration Step-by-step
Continuous Integration Step-by-stepContinuous Integration Step-by-step
Continuous Integration Step-by-stepMichelangelo van Dam
 

What's hot (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 to Daniel Sloof: Magento on HHVM

Подталкиваем PHP к пределу возможностей, Michael Armstrong (lite speed techno...
Подталкиваем PHP к пределу возможностей, Michael Armstrong (lite speed techno...Подталкиваем PHP к пределу возможностей, Michael Armstrong (lite speed techno...
Подталкиваем PHP к пределу возможностей, Michael Armstrong (lite speed techno...Ontico
 
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 PHPChau 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 PHPVõ Duy Tuấn
 
zingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphpzingmepracticeforbuildingscalablewebsitewithphp
zingmepracticeforbuildingscalablewebsitewithphphazzaz
 
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 phpNguyen Duc Phu
 
Continuous Integration In Php
Continuous Integration In PhpContinuous Integration In Php
Continuous Integration In PhpWilco Jansen
 
Best Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentBest Practices in PHP Application Deployment
Best Practices in PHP Application DeploymentShahar Evron
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testingEngineor
 
HipHop Virtual Machine
HipHop Virtual MachineHipHop Virtual Machine
HipHop Virtual MachineRadu Murzea
 
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 8Wim Godden
 
Getting Started with PHP Extensions
Getting Started with PHP ExtensionsGetting Started with PHP Extensions
Getting Started with PHP ExtensionsMichaelBrunoLochemem
 
Drupal hhvm benchmark
Drupal hhvm benchmarkDrupal hhvm benchmark
Drupal hhvm benchmarkLe Thanh Sang
 
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)Engineor
 
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 TestingShyam Sunder Verma
 
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 2016Badoo
 
"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 2012Blend Interactive
 

Similar to 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
 

More from Meet Magento Poland

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...Meet Magento Poland
 
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 ResponsiveMeet Magento Poland
 
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 ConversionsMeet Magento Poland
 
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 buyMeet Magento Poland
 
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 sieciMeet Magento Poland
 
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-commerceMeet Magento Poland
 
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!Meet Magento Poland
 
Fabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOL
Fabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOLFabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOL
Fabien Blechschmidt: HYPERTEXT TRANSFER PROTOCOLMeet 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 VarnishMeet 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 affordableMeet 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 SAPMeet 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 MagentoMeet 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 MagentoMeet 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
 
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 messagesMeet Magento Poland
 
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...Meet Magento Poland
 
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 viewMeet Magento Poland
 

More from 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
 

Recently uploaded

Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCamilleBoulbin1
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Vipesco
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaKayode Fayemi
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
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 IIINhPhngng3
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lodhisaajjda
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
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 FolorunsoKayode Fayemi
 
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 Treatmentnswingard
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxNikitaBankoti2
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyPooja Nehwal
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfSenaatti-kiinteistöt
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxmohammadalnahdi22
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 

Recently uploaded (20)

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
 
Causes of poverty in France presentation.pptx
Causes of poverty in France presentation.pptxCauses of poverty in France presentation.pptx
Causes of poverty in France presentation.pptx
 
Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510Thirunelveli call girls Tamil escorts 7877702510
Thirunelveli call girls Tamil escorts 7877702510
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
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
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.lONG QUESTION ANSWER PAKISTAN STUDIES10.
lONG QUESTION ANSWER PAKISTAN STUDIES10.
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
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
 
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
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptxMohammad_Alnahdi_Oral_Presentation_Assignment.pptx
Mohammad_Alnahdi_Oral_Presentation_Assignment.pptx
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 

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/