19. ● Think as readonly filesystem
● Don’t let the user wait
● Caches are your friends
->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchma
● Try to quit from the optimization-cycle
23. HHVM = PHP++ ?
->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchma
(HHVM is a great opportunity for Symfony and for object oriented lovers)
25. symfonyecosystem
● [ASSETIC] use assetic and CDN, compress and minify files
● [SWIFT MAILER] email in the spool like Redis/Gearman or MQ
(remember to flush)
● [PROXY] no logic in the constructor!
<service id="foo" class="AcmeFoo" lazy="true" />
->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchma
26. [MONOLOG]
don’t log to file in production
debugging: Sentry or Graylog
->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchma
32. UOWeffect
TLDR;
keeps track changes of objects
and coordinates the writing
->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchma
Maintains
a list of objects affected by a business transaction
and coordinates the writing out of changes and the
resolution of concurrency problems
35. UOWeffect
flush is expensive*
while { …. $this->em->persist($v); $this->em->flush() }
->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchma
* profile your domain first.
36. Reducing the flush cost*
— Number of managed Entities
— Type of entities (Read-Only)
$em->flush($entity);
/**
* @Entity
* @READONLY*/
Class Status {
$em->getUnitOfWork()
->markReadOnly($entity);
->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchma
* if you really need
37. Reducing the flush cost*
/** @Entity
* @ChangeTrackingPolicy("DEFERRED_EXPLICIT”)
tracking policy
implicit DB === UOW explicit DB != OUW
->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchma
* if you really need
45. measure … and Metrics?
● Behaviour
● Measure applications data
● Don’t use for benchmarking
Visual tool to better understand the reality
->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchmark->profile->make change->benchma