Replies: 1 comment 1 reply
-
enabling level 2 optimization forces you to re-dump the autoloader each time you change the list of available classes, which is a big burden on DX. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there, I had all the time the impression that we should not use
-o
forcomposer
commands for development, but only when we deploy things to production.From the composer docs:
I just stumbled upon an issue in our development team yesterday, where two guys had a huge difference in performance for some API endpoints. And by "huge difference" I mean like 200ms vs 2.000ms => factor 10. We boiled it down to this flag and could reproduce both versions (the slow one and the faster one) on both machines just by running
composer dumpautoload
orcomposer dumpautoload -o
. We also tried to add classes after we executedcomposer dumpautoload -o
and the were found by the autoloader.We're using macOS and our application runs inside docker containers, this surely causes these problems.
So my question is: Is that part of the documentation still valid from your point of view? Maybe it's still worth to add a section that informs users with a similar setup like mine to use that flag anyway, also during development?
Beta Was this translation helpful? Give feedback.
All reactions