Symfony2: the world slowest framework

Preview:

DESCRIPTION

I benchmark effettuati su molti framework PHP negli ultimi mesi mostrano una netta inferiorità di Symfony2 rispetto agli altri. In questo talk parleremo del perchè i benchmark sulla velocità non rappresentano il vero valore di Symfony2, mentre lo sono la flessibiità, la modularità e l'aderenza a degli standard. Parleremo delle caratteristiche che rendono questo framework uno dei più usati in ambito PHP, anche solo considerando quanti altri framework stanno integrando parti di esso. Infine, parleremo di come questo framework metta nelle mani di chi lo utilizza strumenti molto potenti (e a volte complessi) e lasci la responsabilità di come utilizzarli a noi sviluppatori. In questo momento vale come mai prima la massima 'da grande potere deriva grande responsabilità'.

Citation preview

Symfony2The world slowest framework

venerdì 18 ottobre 13

What’s 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-specific software.

http://en.wikipedia.org/wiki/Software_framework

venerdì 18 ottobre 13

FrameworkVS

Library

Inversion of Control

venerdì 18 ottobre 13

Framework

ValueAND

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

Steep learning curve

Symfony: beware of

venerdì 18 ottobre 13

Symfony: beware of

from great powercomes great responsability

venerdì 18 ottobre 13

Community

Why I choose Symfony

venerdì 18 ottobre 13

Why I choose Symfony

Adhere to standards

venerdì 18 ottobre 13

Frameworks are developers tools

Why I choose Symfony

venerdì 18 ottobre 13

No need for the full package

[thanks composer!]

Why I choose Symfony

venerdì 18 ottobre 13

Based on HTTP

[request/response, caching, reverse proxy, esi]

Why I choose Symfony

venerdì 18 ottobre 13

To Production

php app/check.php

venerdì 18 ottobre 13

AppCache.php is your friend

To Production

venerdì 18 ottobre 13

Doctrine

query_cache_drivermetadata_cache_driver

result_cache_driver

APC - Memcache - XCache - Redis

To Production

venerdì 18 ottobre 13

Profiler

No, thanks.

Always add ‘--env=prod’ to command

To Production

venerdì 18 ottobre 13

Logging

Only errors, thanks.

To Production

Monolog ‘buer_size’ parameter

venerdì 18 ottobre 13

Apache routes

php app/console router:dump-apache -e=prod --no-debug

To Production

venerdì 18 ottobre 13

Assetic

php app/console assetic:dump --env=prod --no-debug

To Production

venerdì 18 ottobre 13

Composer

php composer.phar install --optimize-autoloader

To Production

venerdì 18 ottobre 13

PHP < 5.5 => APC

PHP >= 5.5 => OPCache

To Production

venerdì 18 ottobre 13

3. Premature optimization is the route of all evil

My Conclusion

2. Readability matters

1. Choose on your needs

venerdì 18 ottobre 13

Thanks

Filippo De Santis

@filippodesantis

fd@ideato.it

venerdì 18 ottobre 13

http://slides.seld.be/?file=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://stackoverflow.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

Refs

venerdì 18 ottobre 13