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

[Doctrine] Hydration profiling #4939

Closed
Seldaek opened this issue Jul 16, 2012 · 7 comments
Closed

[Doctrine] Hydration profiling #4939

Seldaek opened this issue Jul 16, 2012 · 7 comments
Labels

Comments

@Seldaek
Copy link
Member

Seldaek commented Jul 16, 2012

At the moment, the DoctrineDataCollector reports the query duration, but not the time it takes to hydrate. I see a query taking 0.5sec and my controller taking 20seconds in the timeline. If the doctrine pane reported the query as having taken 0.5sec + ~20sec to hydrate, it would be a bit easier to see what the hell is going on.

@stof
Copy link
Member

stof commented Jul 16, 2012

At the moment, the ORM does not provide any way to collect this data

@Seldaek
Copy link
Member Author

Seldaek commented Jul 16, 2012

Yeah, I checked and I guess it would be doable by extending the EM & wrapping the hydrator, but it's not a small task and it would stop working if people extend the EM themselves.

@stof
Copy link
Member

stof commented Jul 16, 2012

It would not work this way. The hydration is not handled by the EM. Proxies and persistent collections don't use the EM, meaning you would loose many hydrations.

@Seldaek
Copy link
Member Author

Seldaek commented Jul 16, 2012

Well I don't know if anything else creates hydrators, but extending the EM was just a way to wrap the hydrators so that we can collect info when they're called.

@stof
Copy link
Member

stof commented Jul 16, 2012

As I said previously, both collections and proxies also call the hydrators, without going through the entity manager.

@Seldaek
Copy link
Member Author

Seldaek commented Jul 16, 2012

And as I said, the goal is just to wrap the hydrators inside the EM. From a quick search the only place where hydrators are instantiate seems to be in EM::newHydrator - if you extend that with:

    public function newHydrator($hydrationMode)
    {
        return new HydratorWrapper(parent::newHydrator($hydrationMode));
    }

Then they should hopefully all be created with wrappers, and passed to the proxies and collections with the wrappers.

The missing piece is an interface for hydrators.

@stof
Copy link
Member

stof commented Sep 7, 2012

Moved as doctrine/DoctrineBundle#109

@stof stof closed this as completed Sep 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants