SlideShare a Scribd company logo
Submit Search
Upload
Login
Signup
PHP Performance SfLive 2010
Report
De Cock Xavier
Follow
Freelance Performance / Infrastructure at Mediargus - Gopress
Feb. 17, 2010
•
0 likes
•
8,283 views
1
of
21
PHP Performance SfLive 2010
Feb. 17, 2010
•
0 likes
•
8,283 views
Download Now
Download to read offline
Report
Technology
Php performance presentation on symfony live
De Cock Xavier
Follow
Freelance Performance / Infrastructure at Mediargus - Gopress
Recommended
I, For One, Welcome Our New Perl6 Overlords
heumann
712 views
•
129 slides
Yapcasia2011 - Hello Embed Perl
Hideaki Ohno
1.5K views
•
38 slides
Nigel hamilton-megameet-2013
trexy
1.6K views
•
31 slides
2016年のPerl (Long version)
charsbar
5.1K views
•
67 slides
Mona cheatsheet
Ce.Se.N.A. Security
5.9K views
•
5 slides
Exploit techniques - a quick review
Ce.Se.N.A. Security
1.9K views
•
6 slides
More Related Content
What's hot
PHP Tips for certification - OdW13
julien pauli
5.8K views
•
31 slides
Working with databases in Perl
Laurent Dami
4.6K views
•
50 slides
Perl.Hacks.On.Vim
Lin Yo-An
107.6K views
•
225 slides
Just-In-Time Compiler in PHP 8
Nikita Popov
1.6K views
•
80 slides
Anatomy of a PHP Request ( UTOSC 2010 )
Joseph Scott
1.9K views
•
40 slides
SPL, not a bridge too far
Michelangelo van Dam
1.7K views
•
42 slides
What's hot
(20)
PHP Tips for certification - OdW13
julien pauli
•
5.8K views
Working with databases in Perl
Laurent Dami
•
4.6K views
Perl.Hacks.On.Vim
Lin Yo-An
•
107.6K views
Just-In-Time Compiler in PHP 8
Nikita Popov
•
1.6K views
Anatomy of a PHP Request ( UTOSC 2010 )
Joseph Scott
•
1.9K views
SPL, not a bridge too far
Michelangelo van Dam
•
1.7K views
What's new in PHP 8.0?
Nikita Popov
•
3.1K views
Better detection of what modules are used by some Perl 5 code
charsbar
•
3.7K views
Good Evils In Perl
Kang-min Liu
•
13.8K views
Code Generation in PHP - PHPConf 2015
Lin Yo-An
•
2.4K views
Zend Certification Preparation Tutorial
Lorna Mitchell
•
24.3K views
Preparing for the next PHP version (5.6)
Damien Seguy
•
1.2K views
Damien seguy php 5.6
Damien Seguy
•
1.3K views
Looping the Loop with SPL Iterators
Mark Baker
•
238 views
Findbin libs
Workhorse Computing
•
156 views
Static Optimization of PHP bytecode (PHPSC 2017)
Nikita Popov
•
7.8K views
Metadata-driven Testing
Workhorse Computing
•
510 views
Puppet Camp Paris 2015: Power of Puppet 4 (Beginner)
Puppet
•
1.4K views
Php in 2013 (Web-5 2013 conference)
julien pauli
•
2.8K views
PHP5.5 is Here
julien pauli
•
13.6K views
Similar to PHP Performance SfLive 2010
PHP Internals and Virtual Machine
julien pauli
639 views
•
31 slides
2010 Smith Scripting101
bokonen
666 views
•
44 slides
Quick tour of PHP from inside
julien pauli
11.3K views
•
67 slides
PHP in 2018 - Q4 - AFUP Limoges
✅ William Pinaud
656 views
•
47 slides
Being functional in PHP (PHPDay Italy 2016)
David de Boer
1.4K views
•
63 slides
Perl Moderno
Tiago Peczenyj
865 views
•
106 slides
Similar to PHP Performance SfLive 2010
(20)
PHP Internals and Virtual Machine
julien pauli
•
639 views
2010 Smith Scripting101
bokonen
•
666 views
Quick tour of PHP from inside
julien pauli
•
11.3K views
PHP in 2018 - Q4 - AFUP Limoges
✅ William Pinaud
•
656 views
Being functional in PHP (PHPDay Italy 2016)
David de Boer
•
1.4K views
Perl Moderno
Tiago Peczenyj
•
865 views
Good Evils In Perl (Yapc Asia)
Kang-min Liu
•
8.9K views
Php 7 evolution
Félix Gómez López
•
970 views
Why async and functional programming in PHP7 suck and how to get overr it?
Lucas Witold Adamus
•
1.5K views
Whatsnew in-perl
daoswald
•
187 views
OPL best practices - Doing more with less easier
Alex Fleischer
•
3K views
Debugging: Rules And Tools - PHPTek 11 Version
Ian Barber
•
1.5K views
ES6 Simplified
Carlos Ble
•
1.5K views
Writing Maintainable Perl
tinypigdotcom
•
1.3K views
More than syntax
Wooga
•
2.4K views
DevOps in PHP environment
Evaldo Felipe
•
703 views
JavaScript for PHP developers
Stoyan Stefanov
•
15.6K views
Introduction to Assembly Language
Motaz Saad
•
4.7K views
Modern Perl
Marcos Rebelo
•
1.8K views
Being functional in PHP
David de Boer
•
812 views
Recently uploaded
2023 Ivanti September Patch Tuesday
Ivanti
97 views
•
49 slides
Enhance Productivity Expert Laptop Support For Modern Professional
IT Services Helps
15 views
•
11 slides
Unleashing the Power of Modern Carpooling Apps, Inspired by BlaBlaCar
Archie Cadell
30 views
•
14 slides
Industry 4.0.pdf
Tery Lockitski
36 views
•
8 slides
web test repair.pptx
YuanzhangLin
25 views
•
26 slides
Cloud Composer workshop at Airflow Summit 2023.pdf
Leah Cole
74 views
•
80 slides
Recently uploaded
(20)
2023 Ivanti September Patch Tuesday
Ivanti
•
97 views
Enhance Productivity Expert Laptop Support For Modern Professional
IT Services Helps
•
15 views
Unleashing the Power of Modern Carpooling Apps, Inspired by BlaBlaCar
Archie Cadell
•
30 views
Industry 4.0.pdf
Tery Lockitski
•
36 views
web test repair.pptx
YuanzhangLin
•
25 views
Cloud Composer workshop at Airflow Summit 2023.pdf
Leah Cole
•
74 views
class and object in c++.pptx
Adarsh College, Hingoli
•
184 views
How to use the Cataloguing Code Ethics at your day job : a hands-on workshop ...
CILIP MDG
•
30 views
who we are - values.pptx
LauraGarceran
•
33 views
Improving Employee Experiences on Cisco RoomOS Devices, Webex, and Microsoft ...
ThousandEyes
•
60 views
Metadata & Discovery Group Conference 2023 - Day 1 Programme
CILIP MDG
•
23 views
Data Formats: Reading and writing JSON – XML - YAML
CSUC - Consorci de Serveis Universitaris de Catalunya
•
53 views
Die ultimative Anleitung für HCL Nomad Web Administratoren
panagenda
•
57 views
Framing Few Shot Knowledge Graph Completion with Large Language Models
MODUL Technology GmbH
•
25 views
Understanding Wireguard, TLS and Workload Identity
Christian Posta
•
96 views
The Ultimate Administrator’s Guide to HCL Nomad Web
panagenda
•
50 views
Orchestration, Automation and Virtualisation Maturity Model
CSUC - Consorci de Serveis Universitaris de Catalunya
•
51 views
Elevate Your Enterprise with FME 23.1
Safe Software
•
271 views
Accelerating Data Science through Feature Platform, Transformers, and GenAI
FeatureByte
•
133 views
TEKART CON 2023
AdedoyinSamuel1
•
22 views
PHP Performance SfLive 2010
1.
PHP Performances De
Cock Xavier
2.
3.
4.
5.
6.
Extensions providing functionalities
7.
8.
Source code compilation
to Opcode
9.
Opcode Handling
10.
Memory management
11.
12.
13.
Automatic type conversion
14.
Automatic garbage collection
when ref_count is 0
15.
As of PHP
5.3 Cyclic garbage collector
16.
Zval Examples <?php
$a = 41 ; /* Context ("a" => Zval_1); * Zval_1 {ref_count:1, value:41, type:LONG}; */ $b = $a ; /* Context ("a" => Zval_1, "b" => Zval_1); * Zval_1 {ref_count:2, value:41, type:LONG}; */ $b ++ ; /* Context ("a"=> Zval_1, "b" => Zval_2); * Zval_1 {ref_count:1, value:41, type:LONG}; * Zval_2 {ref_count:1, value:42, type:LONG}; */ $b .= ", The answer ..." ; /* Context ("a"=> Zval_1, "b" => Zval_3); * Zval_1 {ref_count:1, value:41, type:LONG}; * Zval_2 {ref_count:0, value:42, type:LONG}; // Freed * Zval_3 {ref_count:1, value:"42, The answer ...", type:STRING}; */
17.
18.
19.
20.
Op1
21.
Op2
22.
Metas (line n°,
handler, result, ...)
23.
Opcode examples <?php
echo "Hello", " ", "World"; filename: /home/xavier/- function name: (null) number of ops: 5 compiled vars: none line # op operands --------------------------------------------- 2 0 ECHO OP1[ 'Hello' ] 1 ECHO OP1[ ' ' ] 2 ECHO OP1[ 'World' ] 4 3 RETURN OP1[ 1 ] 4* ZEND_HANDLE_EXCEPTION
24.
Opcode examples <?php
echo "Hello"." "."World"; filename: /home/xavier/- function name: (null) number of ops: 5 compiled vars: none line # op return operands --------------------------------------- 2 0 CONCAT RES[ ~0 ] OP1[ 'Hello' ] OP2[ '+' ] 1 CONCAT RES[ ~1 ] OP1[ ~0 ] OP2[ 'World' ] 2 ECHO OP1[ ~1 ] 3 3 RETURN OP1[ 1 ] 4* ZEND_HANDLE_EXCEPTION
25.
26.
Arrays
27.
Object Properties
28.
Ini Directives, included
Files
29.
Classes, Functions, Constants
30.
31.
32.
33.
34.
Break them before
unset
35.
36.
SwiftMailer Examples Implementation
1 foreach ( unpack ('C*' , $bytes ) as $byte ) // Convert String to int array { $this -> _array [] = pack ('C' , $byte ); // Function Call in tight loop } filename: /home/xavier/Bureau/php-5.3.1/ext/- function name: (null) number of ops: 17 compiled vars: !0 = $bytes, !1 = $byte line # op return operands ----------------------------------------------- 2 0 SEND_VAL OP1[ 'C*' ] 1 SEND_VAR OP1[ !0 ] 2 DO_FCALL OP1[ 'unpack' ] 3 FE_RESET RES[ $1 ] OP1[ $0 ] OP2[ ->14 ] 4 FE_FETCH RES[ $2 ] OP1[ $1 ] OP2[ ->14 ] 5 ZEND_OP_DATA RES[ UNUSED ] OP1[ UNUSED ] OP2[ UNUSED ] 6 ASSIGN OP1[ !1 ] OP2[ $2 ] 4 7 SEND_VAL OP1[ 'C' ] 8 SEND_VAR OP1[ !1 ] 9 DO_FCALL OP1[ 'pack' ] 10 FETCH_OBJ_W RES[ $4 ] OP1[ UNUSED ] OP2[ '_array' ] 11 ZEND_ASSIGN_DIM OP1[ $4 ] OP2[ UNUSED ] 12 ZEND_OP_DATA RES[ UNUSED ] OP1[ $6 ] OP2[ $7 ] 5 13 JMP OP1[ ->4 ] 14 SWITCH_FREE RES[ UNUSED ] OP1[ $1 ] 6 15 RETURN OP1[ 1 ] 16* ZEND_HANDLE_EXCEPTION
37.
SwiftMailer Examples Implementation
2 $to_add = str_split ( $bytes ); // Convert string to char array /* add the array as first arg of the function */ array_unshift ( $to_add , & $this -> _array ); // Will trigger E_STRICT /* Push all elements in one function call and get the count */ $this -> _arraySize = call_user_func_array ('array_push' , $to_add ); compiled vars: !0 = $to_add, !1 = $bytes line # op return operands -------------------------------------------------------------------------- 2 0 SEND_VAR OP1[ !1 ] 1 DO_FCALL OP1[ 'str_split' ] 2 ASSIGN OP1[ !0 ] OP2[ $0 ] 4 3 SEND_REF RES[ UNUSED ] OP1[ !0 ] OP2[ UNUSED ] 4 FETCH_OBJ_W RES[ $2 ] OP1[ UNUSED ] OP2[ '_array' ] 5 SEND_REF RES[ UNUSED ] OP1[ $2 ] OP2[ UNUSED ] 6 DO_FCALL OP1[ 'array_unshift' ] 6 7 SEND_VAL OP1[ 'array_push' ] 8 SEND_VAR OP1[ !0 ] 9 DO_FCALL OP1[ 'call_user_func_array' ] 10 ZEND_ASSIGN_OBJ OP1[ UNUSED ] OP2[ '_arraySize' ] 11 ZEND_OP_DATA RES[ UNUSED ] OP1[ $5 ] OP2[ UNUSED ] 7 12 RETURN OP1[ 1 ] 13* ZEND_HANDLE_EXCEPTION
38.
SwiftMailer Examples Implementation
3 $to_add = str_split ( $bytes ); // Convert string to char array /* Calls array Merge */ /* Array merge works by copying the first array element By element, then the second, third, … The speed decreases with the number of items in each array */ $this -> _array = array_merge ( $this -> _array , $to_add ); $this -> _arraySize = count ( $this -> _array ); compiled vars: !0 = $to_add, !1 = $bytes line # op return operands ------------------------------------------------------------------------------- 2 0 SEND_VAR OP1[ !1 ] 1 DO_FCALL OP1[ 'str_split' ] 2 ASSIGN OP1[ !0 ] OP2[ $0 ] 7 3 FETCH_OBJ_R RES[ $3 ] OP1[ UNUSED ] OP2[ '_array' ] 4 SEND_VAR OP1[ $3 ] 5 SEND_VAR OP1[ !0 ] 6 DO_FCALL OP1[ 'array_merge' ] 7 ZEND_ASSIGN_OBJ OP1[ UNUSED ] OP2[ '_array' ] 8 ZEND_OP_DATA RES[ UNUSED ] OP1[ $4 ] OP2[ UNUSED ] 8 9 FETCH_OBJ_R RES[ $6 ] OP1[ UNUSED ] OP2[ '_array' ] 10 SEND_VAR OP1[ $6 ] 11 DO_FCALL OP1[ 'count' ] 12 ZEND_ASSIGN_OBJ OP1[ UNUSED ] OP2[ '_arraySize' ] 13 ZEND_OP_DATA RES[ UNUSED ] OP1[ $7 ] OP2[ UNUSED ] 10 14 RETURN OP1[ 1 ] 15* ZEND_HANDLE_EXCEPTION
39.
SwiftMailer Examples Implementation
4 $to_add = str_split ( $bytes ); foreach ( $to_add as $value ) { $this -> _array [] = $value ; } $this -> _arraySize = count ( $this -> _array ); compiled vars: !0 = $to_add, !1 = $bytes, !2 = $value line # op return operands -------------------------------------------------------------------------- 1 0 SEND_VAR OP1[ !1 ] 1 DO_FCALL OP1[ 'str_split' ] 2 ASSIGN OP1[ !0 ] OP2[ $0 ] 2 3 FE_RESET RES[ $2 ] OP1[ !0 ] OP2[ ->11 ] 4 FE_FETCH RES[ $3 ] OP1[ $2 ] OP2[ ->11 ] 5 ZEND_OP_DATA RES[ UNUSED ] OP1[ UNUSED ] OP2[ UNUSED ] 6 ASSIGN OP1[ !2 ] OP2[ $3 ] 3 7 FETCH_OBJ_W RES[ $5 ] OP1[ UNUSED ] OP2[ '_array' ] 8 ZEND_ASSIGN_DIM OP1[ $5 ] OP2[ UNUSED ] 9 ZEND_OP_DATA RES[ UNUSED ] OP1[ !2 ] OP2[ $7 ] 4 10 JMP OP1[ ->4 ] 11 SWITCH_FREE RES[ UNUSED ] OP1[ $2 ] 5 12 FETCH_OBJ_R RES[ $9 ] OP1[ UNUSED ] OP2[ '_array' ] 13 SEND_VAR OP1[ $9 ] 14 DO_FCALL OP1[ 'count' ] 15 ZEND_ASSIGN_OBJ OP1[ UNUSED ] OP2[ '_arraySize' ] 16 ZEND_OP_DATA RES[ UNUSED ] OP1[ $10 ] OP2[ UNUSED ] 6 17 RETURN OP1[ 1 ] 18* ZEND_HANDLE_EXCEPTION
40.
41.
42.
Xdebug / Zend
Debug – Profilers
43.
44.
Use Opcode Caching
: APC, eAccelerator, XCache, Zend Server, …
45.
Use data Caching
: Memcached, …
46.
Optimize your SQL
47.
Access your data
by batches
48.
Create PHP Extension
49.
Use other implementations
: Facebook's HipHop, phc, Quercus, RoadSend PHP
50.
Questions? Thanks for
listening