[DCOM-176] [GH-256] Refactored AnnotationDriver to handle only required classes Created: 01/Mar/13  Updated: 01/Mar/13  Resolved: 01/Mar/13

Status: Closed
Project: Doctrine Common
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Benjamin Eberlei Assignee: Marco Pivetta
Resolution: Invalid Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of mattcockayne:

Url: https://github.com/doctrine/common/pull/256

Message:

Whilst debugging an issue I was having I found that the AnnotationDriver uses get_declared_classes() and iterates over the result to identify classes that should be handled.

This seems like a ridiculous overhead especially as it then instantiated a ReflectionClass for each declared class. As an example my current project was iterating over 522 items when it needed to only handle 6.

I've kept the alterations to a minimum but it now takes a snapshot of the declared classes before and after the require for the files and then uses array_diff to get only the classes we are targeting.



 Comments   
Comment by Marco Pivetta [ 01/Mar/13 ]

Patch breaks logic when files where already included

Comment by Benjamin Eberlei [ 01/Mar/13 ]

A related Github Pull-Request [GH-256] was closed
https://github.com/doctrine/common/pull/256

Generated at Sun Sep 21 14:22:16 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.