Core: Reflexion Docblock is very costly for a very small gain

Created on 28 May 2018  Â·  8Comments  Â·  Source: api-platform/core

We have nearly 70 entities, and when profiling, we detected that reflection/doc-block is very costly (nearly 20 seconds, see screenshot below).

Apparently it is only used to read entity summary (so I removed it in my case).

I think the PhpDocResourceMetadataFactory file may need a cache.

screenshot-2018-5-28 untitled profile - blackfire

Most helpful comment

OK my bad, I saw that while profiling behat, so in test mode.

Le lun. 28 mai 2018 à 16:53, Kévin Dunglas notifications@github.com a
écrit :

Are you in prod mode?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/api-platform/core/issues/1981#issuecomment-392547490,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABVWxTQ_PeYQKlcf_rCJfyez5u_ZPWp7ks5t3A91gaJpZM4UQSP3
.

All 8 comments

It is cached (PropertyInfo takes care of this). There is something weird with your setup.

Are you in prod mode?

OK my bad, I saw that while profiling behat, so in test mode.

Le lun. 28 mai 2018 à 16:53, Kévin Dunglas notifications@github.com a
écrit :

Are you in prod mode?

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/api-platform/core/issues/1981#issuecomment-392547490,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABVWxTQ_PeYQKlcf_rCJfyez5u_ZPWp7ks5t3A91gaJpZM4UQSP3
.

Be sure to use:

parameters:
   api_platform.metadata_cache: true

in your Behat test app.

See #1725. It was also backported to 2.2.

We need to add this in the Flex recipe btw.

@teohhanhui I was for the record ;)

And the cache is still not used?

Nope, as it's not an api-platform cache IIRC

Was this page helpful?
0 / 5 - 0 ratings