We're rewriting our API to use the excellent API-Platform library, but it's taking 6 seconds to return a small set of data, and 5 of those seconds are the APIPlatform SerializeListener. Is there any way we can speeed that up? It's a show-stopper.
Asked
Active
Viewed 2,984 times
14
-
6Metadata extraction is slow. Did you enable the metadata cache? ( https://api-platform.com/docs/core/performance#header ) – Federkun Nov 21 '16 at 19:35
-
1I think that's the issue, thanks. It appears that it caches automatically in production, but not in the development environment. – Tac Tacelosky Nov 21 '16 at 22:58
-
4There is some discussion on this issue here: https://github.com/api-platform/core/pull/653 With x-debug enabled, it's very, very slow. – Tac Tacelosky Nov 29 '16 at 14:23
-
@Federkun could please give more information about how to enable the metadata cache ? – famas23 Oct 31 '20 at 15:15
-
@famas23 just install and enable APCu in your PHP. API Platform will take advantage of it automatically. – thefallen Nov 25 '20 at 09:12
-
I have just installed APCu and I see no performance gain in development machine. – KoviNET Apr 06 '21 at 12:29
-
3My suggestion - enable xdebug only when you need it) – Evgeny Ruban Jun 02 '21 at 18:03
-
I confirm, independently of api-platform, Xdebug makes loading very slow especially when "profile" and "trace" are enable, so follow advice of @Evgeny Ruban. – Lounis May 24 '23 at 08:02