"drush fra" takes a lot longer that doing "drush fla" and then grep'ing out those in "overridden" or "needs review" status and then running "drush -y fr module" on only those modues that need to be reverted. We do have quite a few features but on our site running "drush fla" and "drush -y fr xxx" on one feature takes around 2 min 30 seconds user time from "time" command. However running "drush -y fra" on site in same state takes well over 5 minutes.
This is true on both our D6 and our D7 sites. We are currently on 7.x-1.0-beta4 and 6.x-1.2 versions of features.
In next comment will include a patch that speeds up greating and leaves "drush fra" to still work as before in results.
Here are time results on our site:
root@a.bcmiller.allplayers.com:/mnt/apci/main/www/sites/all/modules/contrib/features# time drush -y frn
The following modules will be reverted: apci_profile_feature
Do you really want to continue? (y/n): y
Reverted variable. [ok]
Do you really want to revert variable? (y/n): y
real 2m30.873s
user 2m21.670s
sys 0m4.290s
root@a.bcmiller.allplayers.com:/mnt/apci/main/www/sites/all/modules/contrib/features# time drush -y fra
The following modules will be reverted: apci_admin_lite_feature, apci_auto_schedule_events, apci_brackets, apci_broadcast_messaging, apci_brochure, apci_calendar, apci_commerce, apci_defaults, apci_event_conflict, apci_feature_background_check, apci_file_uploads, apci_friends_feature, apci_groups, apci_group_operations, apci_members, apci_messaging_feature, apci_misc_feature, apci_mobile_calendar, apci_mobile_defaults, apci_mobile_event_page, apci_mobile_groups, apci_mobile_profile, apci_password_policy, apci_profile_feature, apci_public_api_services, apci_relationships_panel, apci_sms, apci_sports_events, apci_subgroups, apci_webform, spaces_calendar, spaces_dashboard, spaces_og_registration, spaces_photos, spaces_store
Do you really want to continue? (y/n): y
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
^P^PCurrent state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Reverted variable. [ok]
Do you really want to revert variable? (y/n): y
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
Current state already matches defaults, aborting. [ok]
real 5m30.606s
user 4m53.990s
sys 0m29.920s
Comment | File | Size | Author |
---|---|---|---|
#6 | features-fra-filter-1447656.patch | 2.37 KB | smk-ka |
#5 | features-fra_speed-1447656-D6-4.patch | 3.1 KB | bcmiller0 |
#4 | features-fra_speed-1447656-D6-3.patch | 3.09 KB | bcmiller0 |
#4 | features-fra_speed-1447656-D7-3.patch | 3.1 KB | bcmiller0 |
#2 | features-fra_speed-1447656-D7-2.patch | 3.08 KB | bcmiller0 |
Comments
Comment #1
bcmiller0 CreditAttribution: bcmiller0 commentedHere is a patch file, we have used to allow "drush fra" to have the same outcome . The only difference it it runs much faster when few features need to be reverted, and also gives a "drush fla" display at the beginning to show current status of all features.
Here is a time output for when only one feature needs to reverted for comparison to results above.
time drush -y fra
Name Feature Status State
APCI Admin Lite Feature apci_admin_lite_feature Enabled
Auto Schedule Events apci_auto_schedule_events Enabled
Tournament Brackets apci_brackets Enabled
APCI Broadcast Messaging apci_broadcast_messaging Enabled
APCI Brochure apci_brochure Enabled
apci_calendar apci_calendar Enabled
APCI Commerce apci_commerce Enabled
APCI Defaults apci_defaults Enabled
APCI Event Conflict apci_event_conflict Enabled
Background Checks apci_feature_background_check Enabled
Downloads apci_file_uploads Enabled
APCI Friends Feature apci_friends_feature Enabled
Group Info apci_groups Enabled
APCI: Group Operations apci_group_operations Enabled
Members apci_members Enabled
APCI Messaging Feature apci_messaging_feature Enabled
APCI Misc Feature apci_misc_feature Enabled
apci_mobile_calendar apci_mobile_calendar Enabled
APCI Mobile Defaults apci_mobile_defaults Enabled
apci_mobile_event_page apci_mobile_event_page Enabled
apci_mobile_groups apci_mobile_groups Enabled
apci_mobile_profile apci_mobile_profile Enabled
APCI Notifier Feature apci_notifier_feature Disabled
APCI password policy apci_password_policy Enabled
APCI Profile apci_profile_feature Enabled Overridden
APCI: Public API Services apci_public_api_services Enabled
APCI Relationships Panel apci_relationships_panel Enabled
APCI SMS apci_sms Enabled
Sports apci_sports_events Enabled
Subgroups apci_subgroups Enabled
Webforms apci_webform Enabled
Features Tests features_test Disabled
Feeds Fast News feeds_fast_news Disabled
Feeds Import feeds_import Disabled
Feeds News feeds_news Disabled
Calendar spaces_calendar Enabled
Spaces Dashboard spaces_dashboard Enabled
Registration spaces_og_registration Enabled
Photos spaces_photos Enabled
Store spaces_store Enabled
Spaces Tests spaces_test Disabled
The following modules will be reverted: apci_profile_feature
Do you really want to continue? (y/n): y
Reverted variable. [ok]
Do you really want to revert variable? (y/n): y
real 2m37.800s
user 2m25.250s
sys 0m4.390s
Comment #2
bcmiller0 CreditAttribution: bcmiller0 commentedHere is patch for version 7.x-1.0-beta6
Comment #3
longwaveComment #4
bcmiller0 CreditAttribution: bcmiller0 commentedre-rolled patches replacing tabs with spaces...
Comment #5
bcmiller0 CreditAttribution: bcmiller0 commentedsorry missed on tab on d6 version
Comment #6
smk-ka CreditAttribution: smk-ka commentedNice, this patch really helps cutting down the time for feature reverts for large projects. However, I didn't like the tampering with drush_features_list(), so here is my version which tries hard to avoid any unnecessary duplicate code execution by adapting only the required parts from drush_features_list().
Comment #7
hefox CreditAttribution: hefox commentedthis seems an unneeded use of switch (which to my knowledge is a slower than a simple if).
Hm, I wonder if it also speed up if offer an option for it to gather all overridden items and then call features_revert(array(.., ...)), e.g. not call features-revert for each?
Comment #8
jhedstromThis would potentially be faster since calling features-revert involves a separate drush bootstrap for each feature to be reverted. However, since drush 5 supports concurrency, on a sufficiently fast machine, reverting features via
drush_backend_invoke_concurrent()
would probably be the fastest, but its hard to say for sure without benchmarking the 3 different approaches.Comment #9
hefox CreditAttribution: hefox commentedEr, is this fixing a bug? Adding the force reset of features cache
Comment #10
hefox CreditAttribution: hefox commentedComment #11
hefox CreditAttribution: hefox commentedStill curious about #9, and don't really like switch, but other than that looks good.
RTBC for 6.x and 7.x
Thanks
Comment #12
hefox CreditAttribution: hefox commentedThe same trick likely could be applied to drush_features_update_all
Comment #13
mpotter CreditAttribution: mpotter commentedCommited 7.x version to 7ae5657.
Comment #14
hefox CreditAttribution: hefox commentedThis applies and good to go for 6.x if I recall correctly, but I'll verify and rtbc if so when I can
Comment #15
hefox CreditAttribution: hefox commentedBeen running it for a while