[Perf gain] Exclude tests folder in no-dev mode #4564
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi,
Recently I've just saw on different performance tools how composer file "autoload_classmap.php" can impact memory usage on each request. Regardless the project size, this file is very important.
So I've look closer to this file content and I've been surprise to see the number of files used for the differents projects librarys self-tests onto a production server.
So I made a very small patch excluding thoses files on "no-dev" mode (best choice for production).
On a "out of the box" Symfony 2.7.6, it concern 1288 lines on a total of 4332 (still 3044 line).
So I've choice to exclude them on no-dev mode.
Here's a blackfire stacktrace on a optimized autoload
https://blackfire.io/profiles/bf86642d-285c-481c-ae78-06447739b795/graph
And here a normal one to compare:
https://blackfire.io/profiles/4892e5be-07d2-480d-9249-95543599f136/graph
I've think that Test class hasn't utility on a server production mode, and reduce composer footprint is always welcome.