Closed (fixed)
Project:
Drush
Component:
PM (dl, en, up ...)
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
31 Dec 2010 at 17:19 UTC
Updated:
9 Jun 2012 at 21:51 UTC
Jump to comment: Most recent file
Just did some profiling of `drush dd devel` and found that drush_core_find_project_pat('devel') takes 3-4 milliseconds on a small site and would take more once a site is loaded with contrib modules. Lets try to find a faster alternative to recursing all over. Perhaps query system table with drush_db_result(drush_db_select('system', array('filename'), 'name IN (:extensions)', array(':extensions' => $extensions)));
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | drush-1011662.patch | 4.53 KB | jonhattan |
Comments
Comment #1
greg.1.anderson commentedProbably a drush-4.1-timeframe fix.
Comment #2
greg.1.anderson commentedMaybe jonhattan has some ideas on this.
Comment #3
jonhattanTo query the database this command needs bootstrap to _CONFIGURATION (it was reaching _SITE).
Attached patch does what Moshe proposed. Also it fix several things in the way I traced from the command callback to
drush_core_find_project_path(). I think there're more opportunities to polish this.There's a failure in tests but doesn't seem to be related to this. Will investigate it further.
side note 1:
drush_core_rsync()callsdrush_sitealias_evaluate_path()with$os = "rsync".I saw it is documented but it doesn't seem to be used in underlying code.side note 2: while browsing code for this issue I found that this is valid (and not documented):
drush status --project=devel,views.I have a feeling that code involved in all of this can be simplified / decoupled.
Comment #4
greg.1.anderson commentedAnswers to side notes:
For an explanation of
$os = "rsync", see_drush_get_osin environment.inc. This special constant will be converted to "cwrsync" on Windows, which will cause rsync to use cygwin-style path escaping instead of Windows-style path escaping, which is very important if using rsync on Windows.The --project stuff in drush status is used by the site alias code that handles %files or %modulename in a path alias on a remote machine; the status command is used to pull multiple results from the remote machine with a single call. This code could in fact be simplified by making a new hidden command to use in place of status.
Code in the patch looks good.
Comment #5
greg.1.anderson commentedWorks well. There was one comment that is no longer applicable in _drush_core_directory:
Now it would be more applicable to say
drush_sitealias_evaluate_path requires bootstrapping to DRUSH_BOOTSTRAP_DRUPAL_DATABASE.Comment #6
jonhattanCommitted with a change to comment referenced in #5.
btw completeTest fails in master; not related to this commit.
Comment #7
jonhattanMay be backported although it contains a little API change/fix: http://drupalcode.org/project/drush.git/blobdiff/bb03a06fc0c0283a8b1b14b...
Comment #8
msonnabaum commentedNot worth backporting now that 5 is out.