Skip to content

Conversation

@dawehner
Copy link
Contributor

There has been several problems

  • Even we enabled classAnnotationOptimized we expected a different behavior: You cannot parse properties any longer (fixed that by expecting an exception). Therefore moved the test data into a provider so you can check the exception on each of them.
  • Once done I realized that DeeperNamespaceParent had the wrong className
  • Additional I added a test to check that the regex matched.
    StaticReflectionParser::parse regexp is not inclusive enough #307

@doctrinebot
Copy link

Hello,

thank you for creating this pull request. I have automatically opened an issue
on our Jira Bug Tracker for you. See the issue link:

http://www.doctrine-project.org/jira/browse/DCOM-223

We use Jira to track the state of pull requests and the versions they got
included in.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As stated in previous discussion, we don't do this sort of "coding to make it testable" - If there's no way to verify that it's working because there's no change in behavior, then let's just harden the existing tests with more cases

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed now

@chx
Copy link
Contributor

chx commented Dec 12, 2013

we don't do this sort of "coding to make it testable" - If there's no way to verify that it's working because there's no change in behavior, then let's just harden the existing tests with more cases

Aye but now you can't verify whether the optimization works and that's pretty bad for Drupal. Just hope it's not broken this time?

@Ocramius
Copy link
Member

@chx check it out in the environment where stuff breaks and see if the fix does it for you :-)

@chx
Copy link
Contributor

chx commented Dec 12, 2013

It doesn't break because it's an optimization! It just consumes an unholy amount of memory. Some people reported 600mb on longer classes.

@Ocramius
Copy link
Member

@chx yes, I'm saying that checking it out in those environments and monitoring memory usage is the way to go to verify the patch

@chx
Copy link
Contributor

chx commented Dec 12, 2013

Would you then accept a patch here which feeds a, say, 10mb string to the parser and checks memory_get_peak_usage?

@Ocramius
Copy link
Member

@chx if we can use stuff like str_repeat, then probably yes.

@dawehner
Copy link
Contributor Author

@chx
The new test ensures that parsing the properties does not work, aka. the code is not loaded at all.

@chx
Copy link
Contributor

chx commented Dec 12, 2013

Ah, awesome! Let's get this into to Drupal then!

@Ocramius
Copy link
Member

@guilhermeblanco can we get this merged?

guilhermeblanco added a commit that referenced this pull request Jan 12, 2014
fix the optimize regex and adapt the tests to actually test classAnnotat...
@guilhermeblanco guilhermeblanco merged commit a45d110 into doctrine:master Jan 12, 2014
@dawehner
Copy link
Contributor Author

Thank you!

guilhermeblanco added a commit that referenced this pull request May 21, 2014
fix the optimize regex and adapt the tests to actually test classAnnotat...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants