When running updatedb for Drupal 7 sites, Drush does this:
// Rescan and repopulate the system table to ensure we have a full picture
// of the platform.
drush_get_projects();
This results in system_rebuild_module_data() and system_rebuild_theme_data() being called, which is not the fastest operation.
However, the core code that this is based off of does not rebuild the module and theme data here. Looking into it, it shouldn't be necessary. The reason is that a few lines below this one (not visible in the attached patch file, but right below that), http://api.drupal.org/api/function/update_fix_compatibility/7 gets called. This function in turn calls http://api.drupal.org/api/function/update_check_incompatibility/7, which rebuilds the module and theme data itself (and uses a static cache to ensure it only happens once).
So, it doesn't seem like the Drush call does anything, and I've removed it in the attached patch. This results in a noticeable speedup when running drush updatedb.
(Note: I haven't looked to see if a similar improvement could be made for D5 or D6; for now, this patch is just for D7.)
| Comment | File | Size | Author |
|---|---|---|---|
| drush-unnecessary-update-rebuilds.patch | 673 bytes | David_Rothstein |
Comments
Comment #1
moshe weitzman commentedOK, committed. Thanks.