Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PHPNG kontra HHVM
Search
Leszek Krupiński
April 20, 2015
Programming
0
75
PHPNG kontra HHVM
Leszek Krupiński
April 20, 2015
Tweet
Share
More Decks by Leszek Krupiński
See All by Leszek Krupiński
So that the daemon won’t die
leafnode
2
390
Practical PHP7
leafnode
2
400
Dobrze posól swoje hasło
leafnode
0
71
Dobrze posól swoje hasło (z notatkami)
leafnode
0
61
PHPNG kontra HHVM (z notatkami)
leafnode
0
37
Ewolucja PHP: PHP 5.6, NG, PHP 7, HHVM
leafnode
2
270
Sculpin - Generowanie statycznych stron w PHP
leafnode
2
49
Skalowanie aplikacji PHP
leafnode
1
390
Varnish to the Rescue
leafnode
0
100
Other Decks in Programming
See All in Programming
Polars入門
daikikatsuragawa
1
160
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
200
使ってみよう Azure AI Document Intelligence
kosmosebi
2
360
スキーマ駆動開発による品質とスピードの両立 - 私達は何故、スキーマを書くのか
kentaroutakeda
0
180
Node.js v22 で変わること
yosuke_furukawa
PRO
11
3.9k
禅の心を手に入れよ
eltociear
1
280
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
560
SIMD Parallel Programming with the Vector API
josepaumard
0
220
Ruby Function Composition
bkuhlmann
1
340
Scalable Customer Journey Orchestration (CJO)
lewuathe
0
410
Amazon SQSコンシューマー疎結合への旅 - 出張! #DevelopersIO IT技術ブログの中の人が語る勉強会 #3
quiver
0
300
Going beyond Apache Parquet's default settings
xhochy
0
120
Featured
See All Featured
Java REST API Framework Comparison - PWX 2021
mraible
PRO
19
6.9k
Web development in the modern age
philhawksworth
203
10k
Navigating Team Friction
lara
179
13k
WebSockets: Embracing the real-time Web
robhawkes
59
7k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Agile that works and the tools we love
rasmusluckow
325
20k
Rebuilding a faster, lazier Slack
samanthasiow
74
8.2k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
20
1.7k
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
126
32k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
65
14k
What’s in a name? Adding method to the madness
productmarketing
PRO
17
2.7k
Transcript
PHPNG kontra HHVM Leszek Krupiński 4developers 2015
LEAFNODE
None
.pl /PHPersPL +grupy
Teraz
PHP 5.6
Drobne zmiany składniowe
PHP 7
PHP NG
Głęboka refaktoryzacja
Optymalizacja struktur wewnętrznych
Operacje na stosie
Zarządzanie pamięcią
Immutable Array
Efekty
30% lepsze wyniki w testach syntetycznych
20-70% szybsze działanie prawdziwych aplikacji
None
Lies, damned lies, benchmarks
Autor: Dmitry Stogov
Autor: Dmitry Stogov
http://devplant.net/2014/08/11/optimizing-php-code/
Abstract Syntax Tree
LEKSER PARSER / KOMPILATOR URUCHOMIENIE LEKSEMY OPCODE
$y = 5; $y = 5 array[309, ‘$y’, 1] =
array[305, 5, 1] 309 - T_VARIABLE 305 - T_LNUMBER
None
LALR(1) parser Single-pass compiler
[$a, $b, $c] = $array;
LEKSER PARSER / KOMPILATOR URUCHOMIENIE LEKSEMY OPCODE OPCACHE / OPTIMIZER
None
LEKSER PARSER KOMPILATOR URUCHOMIENIE LEKSEMY WĘZŁY AST OPCODE
A = B + C = 1 ; D var
var var var value value value * 2 value products products products sums sums assign assign stmt stmt statements
Usunięcie ograniczeń składniowych
Uruchomienie
Niekompatybilność
ROZSZERZENIA interbase oci8 mssql pdo_oci pdo_dblib sybase_ct
Drobne zmiany w składni
None
HHVM
HipHop for PHP
KOD PHP KOD C KOMPILACJA URUCHOMIENIE
HHVM
KOD PHP BYTECODE JIT COMPILER URUCHOMIENIE
Hack
Return type hinting Member variable types Type-safe collections Generics Type
aliasing Nullable types Tuples Shapes
None
None
None
None
None
XHP
Transpiler
Zgodność HHVM z PHP
Open Source Tests: 95.15% 25 Frameworks at 100% http://hhvm.com/frameworks/
Uruchamianie
HTTP Server PHP FPM Backend class2.php class1.php index.php
HTTP Server HHVM Backend class2.php class1.php index.php
Używać?
1. google.com 2. facebook.com 3. youtube.com 4. yahoo.com 5. baidu.com
6. amazon.com 7. wikipedia.org 8. twitter.com 9. taobao.com 10. qq.com
1. google.com 2. facebook.com 3. youtube.com 4. yahoo.com 5. baidu.com
6. amazon.com 7. wikipedia.org 8. twitter.com 9. taobao.com 10. qq.com
Roadmap 2015 Integracja LLVM Nowe platformy Garbage collector Zarządzanie pamięcią
Wsparcie dla OS X Integracja z Hack typechecker Pliki INI XHP 2.0 w Hack Poprawki zgodności
Fight!
PHPNG/PHP7 + duże community + szeroka baza testowa + perspektywy
(AST) - brak JIT - chaotyczny rozwój
HHVM + wydajność + drop-in zamiast FPM + hack -
zgodność (…ale będzie lepiej) - niewielka baza testowa - duże koszty wdrożenia
Przyszłość
PHP 7
Return type hinting
None
Scalar Type Hints Model hybrydowy
Fatal Exceptions
T_SPACESHIP Because T_PAAMAYIM_NEKUDOTAYIM was not enough.
<=>
Kolejne interpretery
Specyfikacja języka
Czy potrzebne jest wiele interpreterów?
Linki http://bit.ly/phpng-zendcon http://bit.ly/php-ast http://bit.ly/php7timeline https://github.com/php/php-langspec http://bit.ly/hhvm-phpcon2014 https://wiki.php.net/phpng https://wiki.php.net/phpng-int https://wiki.php.net/rfc http://bit.ly/hhvm-etsy
Pytania?
Dziękuję @leafnode http://speakerdeck.com/leafnode/ i zapraszam na mój drugi wykład “Dobrze
posól swoje hasło”, 17:00, Security