Skip to content
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

Performance issues with metadatas #137

Merged
merged 5 commits into from
Dec 4, 2022

Conversation

dmitryuk
Copy link
Contributor

@dmitryuk dmitryuk commented Dec 4, 2022

Closes DamienHarper/auditor-bundle#319
Metadata cache should be configured to start it working

@codecov
Copy link

codecov bot commented Dec 4, 2022

Codecov Report

Merging #137 (d2da374) into 2.x (098fe50) will decrease coverage by 0.03%.
The diff coverage is 94.44%.

@@            Coverage Diff             @@
##              2.x     #137      +/-   ##
==========================================
- Coverage   92.98%   92.95%   -0.04%     
==========================================
  Files          44       44              
  Lines        1526     1561      +35     
==========================================
+ Hits         1419     1451      +32     
- Misses        107      110       +3     
Impacted Files Coverage Δ
src/Provider/Doctrine/DoctrineProvider.php 94.21% <94.11%> (-1.14%) ⬇️
...trine/Auditing/Transaction/TransactionHydrator.php 83.01% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@DamienHarper
Copy link
Owner

Thanks again @dmitryuk! This one was on my roadmap :)
Do you have some sort of before/after benchmark to better understand the gain?

@DamienHarper DamienHarper merged commit 1e2e880 into DamienHarper:2.x Dec 4, 2022
@dmitryuk
Copy link
Contributor Author

dmitryuk commented Dec 5, 2022

Test example:

    public function testExampleAsd()
    {
        $container = self::getContainer();
        $provider = new DoctrineProvider(new Configuration([]));
        $em = $container->get('doctrine.orm.entity_manager');

        for ($i = 0; $i< 50; $i++) {
            $provider->loadAnnotations($em, []);
        }
    }

Without cache: Time: 00:26.980, Memory: 52.50 MB

With cache: Time: 00:01.702, Memory: 46.50 MB

DamienHarper pushed a commit that referenced this pull request Dec 5, 2022
* Cache DH Annotations
* speed
* remove getOwner call

Co-authored-by: a.dmitryuk <a.dmitryuk@movavi.com>
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.

None yet

2 participants