Closed greg0ire closed 4 years ago
Symfony console commands can and should be lazy though :) https://symfony.com/doc/current/console/commands_as_services.html#console-command-service-lazy-loading https://symfony.com/doc/current/console/lazy_commands.html
Yes, I just figured I was doing it wrong: https://twitter.com/greg0ire/status/1192509418262401025 :P
Please fill out the sections below to help us address your issue.
Version of AWS SDK for PHP?
3.98.0
Version of AWS Service Provider for Symfony?
2.0.1
Version of Symfony (
bin/console --version
in project dir)?4.3.3
Version of PHP (
php -v
)?7.1.28
What issue did you see?
When using any Symfony CLI command, every command is instantiated. If a command relies on a S3Client, the S3Client will be instantiated too, and this seems to use a lot of memory, because it is loading a huge json file.
Steps to reproduce
Setting the service as lazy results in a 15% performance gain (thanks Blackfire).