14

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.

Symfony Profiler

Evgeny Ruban
  • 1,357
  • 1
  • 14
  • 20
Tac Tacelosky
  • 3,165
  • 3
  • 27
  • 28
  • 6
    Metadata extraction is slow. Did you enable the metadata cache? ( https://api-platform.com/docs/core/performance#header ) – Federkun Nov 21 '16 at 19:35
  • 1
    I 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
  • 4
    There 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
  • 3
    My 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

0 Answers0