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
98
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
450
Dobrze posól swoje hasło
leafnode
0
100
Dobrze posól swoje hasło (z notatkami)
leafnode
0
89
PHPNG kontra HHVM (z notatkami)
leafnode
0
63
Ewolucja PHP: PHP 5.6, NG, PHP 7, HHVM
leafnode
2
290
Sculpin - Generowanie statycznych stron w PHP
leafnode
2
56
Skalowanie aplikacji PHP
leafnode
1
410
Varnish to the Rescue
leafnode
0
120
Other Decks in Programming
See All in Programming
テスターからテストエンジニアへ ~新米テストエンジニアが歩んだ9ヶ月振り返り~
non0113
2
250
TypeScriptでDXを上げろ! Hono編
yusukebe
4
930
Streamlitで実現できるようになったこと、実現してくれたこと
ayumu_yamaguchi
2
270
React は次の10年を生き残れるか:3つのトレンドから考える
oukayuka
41
16k
一人でAIプロダクトを作るならAIにはもっと働いてもらいたい / I want AI to work harder
rkaga
3
320
それ CLI フレームワークがなくてもできるよ / Building CLI Tools Without Frameworks
orgachem
PRO
17
3.7k
NEWT Backend Evolution
xpromx
1
170
Flutterと Vibe Coding で個人開発!
hyshu
1
230
ZeroETLで始めるDynamoDBとS3の連携
afooooil
0
150
LLMは麻雀を知らなすぎるから俺が教育してやる
po3rin
3
1.9k
decksh - a little language for decks
ajstarks
4
21k
Gemini CLIの"強み"を知る! Gemini CLIとClaude Codeを比較してみた!
kotahisafuru
3
920
Featured
See All Featured
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
21
1.4k
The World Runs on Bad Software
bkeepers
PRO
70
11k
What's in a price? How to price your products and services
michaelherold
246
12k
Documentation Writing (for coders)
carmenintech
73
5k
Building Better People: How to give real-time feedback that sticks.
wjessup
367
19k
Testing 201, or: Great Expectations
jmmastey
45
7.6k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
A designer walks into a library…
pauljervisheath
207
24k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
332
22k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
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