Hammerbot
Hammerbot

Reputation: 16364

Is there a reason Commands are Slower than normal Requests?

I am currently refactoring some code to transform some actions in commands in my Symfony 2.7 application.

At first, I was making a GET request to some endpoint, the corresponding controller was making a call to a service and responded with a 200 http response.

Now, I want to execute this service from a command interface so I use the Console Component of Symfony.

The problem is: The command way is very, very slow. Is there a reason for that?

Upvotes: 2

Views: 1515

Answers (1)

romaricdrigon
romaricdrigon

Reputation: 1587

Commands, by default, are run in dev environment, meaning more logging, capturing data for the profiler...

Try appending --env=prod.

Upvotes: 8

Related Questions