Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
PHPNG kontra HHVM
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Leszek Krupiński
April 20, 2015
Programming
130
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PHPNG kontra HHVM
Leszek Krupiński
April 20, 2015
Transcript
78 slides
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
More Decks by Leszek Krupiński
See All by Leszek Krupiński
So that the daemon won’t die
leafnode
2
420
Practical PHP7
leafnode
2
520
Dobrze posól swoje hasło
leafnode
0
130
Dobrze posól swoje hasło (z notatkami)
leafnode
0
120
PHPNG kontra HHVM (z notatkami)
leafnode
0
92
Ewolucja PHP: PHP 5.6, NG, PHP 7, HHVM
leafnode
2
320
Sculpin - Generowanie statycznych stron w PHP
leafnode
2
85
Skalowanie aplikacji PHP
leafnode
1
440
Varnish to the Rescue
leafnode
0
150
Other Decks in Programming
See All in Programming
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
240
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.7k
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
340
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
3
1.7k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
240
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
160
Long Living Tokens, Die, Die, Die! (or: The One Ring is Banned in Modern)
sylph01
0
420
SODA - FACT BOOK(JP)
sodainc
1
40k
Rails初心者がパスキーを実装してみて大変だったこと
ktombow
0
170
Snowflake Openflow Connector利用の勘所 / 20261024developersio2026tokyo-snowflake-openflow
kasacchiful
PRO
0
330
クラウドゲーミングのパフォーマンス最適化に挑む / Cloud Gaming Performance Tuning
vivion
0
330
Featured
See All Featured
A designer walks into a library…
pauljervisheath
211
25k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
22k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
Exploring anti-patterns in Rails
aemeredith
4
560
Documentation Writing (for coders)
carmenintech
77
5.6k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Bash Introduction
62gerente
615
220k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
610
Odyssey Design
rkendrick25
PRO
3
940
Darren the Foodie - Storyboard
khoart
PRO
5
4.1k