Feature #31788

[PERFORMANCE] cache implementation for AnnotationReader in Flow3AnnotationDriver

Added by rottenrice no-lastname-given about 10 years ago. Updated over 9 years ago.

Status:
Rejected
Priority:
Should have
Category:
Reflection
Target version:
-
Start date:
2011-11-13
Due date:
% Done:

0%

Estimated time:
PHP Version:
Has patch:
No
Complexity:

Description

doctrine has classes to cache the parsed annotations. with cached annotations you can boost the parsetime by ~200ms (=15%, tested with TYPO3.Blog).

some caching strategies:

$this->reader = new \Doctrine\Common\Annotations\CachedReader(
    new \Doctrine\Common\Annotations\IndexedReader(new \Doctrine\Common\Annotations\AnnotationReader()), 
    new \Doctrine\Common\Cache\ApcCache()
);
$this->reader = new \Doctrine\Common\Annotations\CachedReader(
    new \Doctrine\Common\Annotations\IndexedReader(new \Doctrine\Common\Annotations\AnnotationReader()), 
    new \Doctrine\Common\Cache\ArrayCache()
);
$this->reader = new \Doctrine\Common\Annotations\FileCachedReader(
    new \Doctrine\Common\Annotations\IndexedReader(new \Doctrine\Common\Annotations\AnnotationReader()), 
    CACHING_DIR
);

it would be better to use the Objects.yaml to set the caching strategy instead of using __construct()

/**
 * @var \Doctrine\Common\Annotations\AnnotationReader
 */
protected $reader;
i think it is better to use the interface \Doctrine\Common\Annotations\Reader

--
class: TYPO3\FLOW3\Persistence\Doctrine\Mapping\Driver\Flow3AnnotationDriver

Also available in: Atom PDF