Open Chi-teck opened 7 years ago
@Chi-teck thanks for reporting this is a known issue we like to address before the stable release. DO you know which tools we can use to detect why and where is this happening?
You can try drupal --debug
so see which process is being executed
I walked through the code with xdebug and found that Drupal::boot()
takes about 75 % of the request time.
https://github.com/hechoendrupal/drupal-console/blob/master/bin/drupal.php#L49
I think it can be related to how service container is compiled and cached but am not certain.
I also noticed that the older Console version works quite well even a bit faster than Drush.
@Chi-teck I sent a PR https://github.com/hechoendrupal/drupal-console/pull/3155 to compile all of the YAML files where services are registered and create a single file.
As you can see the results the first execution is the one that takes longer because it creates the compiled-services file the rest of the executions only load one file to register console services.
I also found using vendor/bin/drupal
instead of Launcher drupal
is faster.
I will take a look to that project to improve the extra time added when finding the site.
I have a similar problem only rather worse. On my dev machine console boot phase is taking >10s, mostly in the container rebuild. The site also takes this long to rebuild after clearing the cache. Any solution?
I've installed the latest console version (1.0.0-rc15) and discovered that it works quite slow. On fresh site installation (Drupal v8.4.x, PHP 7.0) it takes about 2.5 seconds (!) to execute a simple command like
site:status
.The benchmark above suggests that Drupal console spends at least 1.5 second on something not related to Drupal bootstrapping.
Note that this happens on any command executed in Drupal document root directory even
drupal -v
is very slow.