Feature #31788
[PERFORMANCE] cache implementation for AnnotationReader in Flow3AnnotationDriver
Status: | Rejected | Start date: | 2011-11-13 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | Karsten Dambekalns | % Done: | 0% |
|
Category: | Reflection | |||
Target version: | - | |||
PHP Version: | Complexity: | |||
Has patch: | No |
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
History
#1 Updated by Christopher Hlubek over 3 years ago
+1 for the interface. We should implement a custom CachedReader using the FLOW3 caching framework. Should be fairly easy.
#2 Updated by Karsten Dambekalns over 3 years ago
- Category set to Reflection
- Status changed from New to Needs Feedback
- Assigned To set to Karsten Dambekalns
Christopher Hlubek wrote:
+1 for the interface. We should implement a custom CachedReader using the FLOW3 caching framework. Should be fairly easy.
The strategy currently is to cache the results the ReflectionService builds with the reader. No doubled caching, if it can be avoided.
#3 Updated by Karsten Dambekalns over 3 years ago
- Status changed from Needs Feedback to Rejected
Recent improvements have shown the caching we have in place does the job.