際際滷

際際滷Share a Scribd company logo
Symfony2
The world slowest framework

venerd狸 18 ottobre 13
Whats a framework?

[...] a software framework is an abstraction in which
software providing generic functionality can be
selectively changed by additional user-written code,
thus providing application-speci鍖c software.
http://en.wikipedia.org/wiki/Software_framework

venerd狸 18 ottobre 13
Framework
VS
Library

Inversion of Control

venerd狸 18 ottobre 13
Framework

Value
AND
Technical debt

venerd狸 18 ottobre 13
Speed

venerd狸 18 ottobre 13
Procedural VS OO Code

venerd狸 18 ottobre 13
Procedural VS OO Code

venerd狸 18 ottobre 13
Optimization

venerd狸 18 ottobre 13
Server VS Dev Costs

venerd狸 18 ottobre 13
Freedom to change

venerd狸 18 ottobre 13
What do you need?

venerd狸 18 ottobre 13
What do you like?

venerd狸 18 ottobre 13
Knowledge

venerd狸 18 ottobre 13
Community

venerd狸 18 ottobre 13
Symfony: beware of

Steep learning curve
venerd狸 18 ottobre 13
Symfony: beware of

from great power
comes great responsability
venerd狸 18 ottobre 13
Why I choose Symfony

Community

venerd狸 18 ottobre 13
Why I choose Symfony

Adhere to standards

venerd狸 18 ottobre 13
Why I choose Symfony

Frameworks are developers tools

venerd狸 18 ottobre 13
Why I choose Symfony
No need for the full package
[thanks composer!]

venerd狸 18 ottobre 13
Why I choose Symfony
Based on HTTP
[request/response, caching, reverse proxy, esi]

venerd狸 18 ottobre 13
To Production

php app/check.php

venerd狸 18 ottobre 13
To Production

AppCache.php is your friend

venerd狸 18 ottobre 13
To Production
Doctrine
query_cache_driver
metadata_cache_driver
result_cache_driver

APC - Memcache - XCache - Redis

venerd狸 18 ottobre 13
To Production
Pro鍖ler
No, thanks.
Always add --env=prod to command

venerd狸 18 ottobre 13
To Production
Logging
Only errors, thanks.

Monolog buer_size parameter

venerd狸 18 ottobre 13
To Production
Apache routes
php app/console router:dump-apache -e=prod --no-debug

venerd狸 18 ottobre 13
To Production
Assetic
php app/console assetic:dump --env=prod --no-debug

venerd狸 18 ottobre 13
To Production
Composer
php composer.phar install --optimize-autoloader

venerd狸 18 ottobre 13
To Production
PHP < 5.5 => APC
PHP >= 5.5 => OPCache

venerd狸 18 ottobre 13
My Conclusion
1. Choose on your needs
2. Readability matters
3. Premature optimization is the route of all evil

venerd狸 18 ottobre 13
Thanks
Filippo De Santis
@鍖lippodesantis
fd@ideato.it

venerd狸 18 ottobre 13
Refs
http://slides.seld.be/?鍖le=2011-10-20+High+Performance+Websites+with+Symfony2.html#1
http://www.gregfreeman.org/2013/your-php-framework-choice-doesnt-matter/
https://igor.io/2013/09/02/how-heavy-is-silex.html
http://stackover鍖ow.com/questions/16696763/why-is-symfony2-performing-so-bad-in-benchmarks-and-does-it-matter
http://symfony2-checklist.com/
http://slides.liip.ch/static/2012-05-18_symfony-speed.html#1
http://www.slideshare.net/liuggio/rationally-boost-your-symfony2-application-with-caching-tips-and-monitoring
http://www.nigeldunn.com/2011/11/24/my-last-thoughts-on-symfony2/
http://docs.doctrine-project.org/en/latest/reference/caching.html
http://symfony.com/doc/current/index.html
http://www.emanueleminotto.it/im-afraid-symfony-2-performances
http://www.slideshare.net/liuggio/rationally-boost-your-symfony2-application-with-caching-tips-and-monitoring

venerd狸 18 ottobre 13
PICS
http://www.鍖ickr.com/photos/stankuns/8738770989
http://www.davehakkens.nl/
http://www.鍖ickr.com/photos/takahiro/359406450
http://www.鍖ickr.com/photos/mayhem/2939259129
http://www.鍖ickr.com/photos/pfv/2739621207/
http://www.鍖ickr.com/photos/kitty-kat/6049220331
http://www.鍖ickr.com/photos/mtwashington/5062599268
http://www.鍖ickr.com/photos/harlequeen/6371193319
http://www.鍖ickr.com/photos/28990363@N05/6414310131

venerd狸 18 ottobre 13

More Related Content

Symfony2: the world slowest framework