Skip to content

Tests are signifcantly slower in 3.3.x compared to 3.2.10 #23419

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jrjohnson opened this issue Jul 6, 2017 · 3 comments
Closed

Tests are signifcantly slower in 3.3.x compared to 3.2.10 #23419

jrjohnson opened this issue Jul 6, 2017 · 3 comments

Comments

@jrjohnson
Copy link
Contributor

Q A
Bug report? yes
Feature request? no
BC Break report? no
RFC? no
Symfony version 3.3.x

I'm only certain that this effects applications that use the PHPunit Bridge, but other bundles may have the same issue.

#21837 registers the class_exists loader for annotations which is also added by https://github.com/symfony/phpunit-bridge/blob/master/bootstrap.php#L24

This effectively doubles the calls to class_exists which doubles the calls to spl_autoload_call and makes tests very slow. In one sample test I was seeing 90K more calls to this function. I have created PRs at:
doctrine/annotations#135
symfony/phpunit-bridge#1

As I think this issue should be addressed elsewhere, but I wanted to create this ticket to advertise this problem and seek any advice or recommendations for a better fix.

@kobelobster
Copy link
Contributor

@jrjohnson - Did you find a fix for this? I upated doctrine/annotations to 1.5 but the tests are still slow as hell.

@jrjohnson
Copy link
Contributor Author

If you can update to doctrine/annotations 1.5.0 it improves things substantially, but that upgrade requires PHP 7.1+.

Until we drop PHP 7.0 support in our app we have this in our base test class

public function tearDown()
{
    parent::tearDown();
    // We need to keep the registry clean ourselves until we update to doctrine/annotations 1.5.0
    AnnotationRegistry::reset();
}

@kobelobster
Copy link
Contributor

Yeah, we use 7.1 and I updated to 1.5. What I meant is, that it's faster, but still not the same speed as on 3.2. It was 300% slower and now it's 180% slower. Also see this: #24596

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

No branches or pull requests

3 participants