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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Leszek Krupiński
April 20, 2015
Programming
0
120
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
400
Practical PHP7
leafnode
2
480
Dobrze posól swoje hasło
leafnode
0
120
Dobrze posól swoje hasło (z notatkami)
leafnode
0
110
PHPNG kontra HHVM (z notatkami)
leafnode
0
83
Ewolucja PHP: PHP 5.6, NG, PHP 7, HHVM
leafnode
2
310
Sculpin - Generowanie statycznych stron w PHP
leafnode
2
75
Skalowanie aplikacji PHP
leafnode
1
430
Varnish to the Rescue
leafnode
0
130
Other Decks in Programming
See All in Programming
技術検証結果の整理と解析をAIに任せよう!
keisukeikeda
0
120
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
720
GC言語のWasm化とComponent Modelサポートの実践と課題 - Scalaの場合
tanishiking
0
110
encoding/json/v2のUnmarshalはこう変わった:内部実装で見る設計改善
kurakura0916
0
400
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
430
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
420
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1k
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
100
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
280
Claude Code Skill入門
mayahoney
0
280
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
380
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
120
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
3k
Mind Mapping
helmedeiros
PRO
1
120
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.4k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
Designing for humans not robots
tammielis
254
26k
Ruling the World: When Life Gets Gamed
codingconduct
0
170
Skip the Path - Find Your Career Trail
mkilby
1
76
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
140
sira's awesome portfolio website redesign presentation
elsirapls
0
190
Evolving SEO for Evolving Search Engines
ryanjones
0
150
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
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