Feature #31788

[PERFORMANCE] cache implementation for AnnotationReader in Flow3AnnotationDriver

Added by rottenrice no-lastname-given almost 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

#1

Updated by Christopher Hlubek almost 10 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 almost 10 years ago

  • Category set to Reflection
  • Status changed from New to Needs Feedback
  • Assignee 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 9 years ago

  • Status changed from Needs Feedback to Rejected

Recent improvements have shown the caching we have in place does the job.

Also available in: Atom PDF