We have more than 20 message types and when it came to features-reverting a simple change in the definition, it has taken us more than 30 minutes to perform the revert.

Here is an optimization that has dramatically improved the speed of feature reverts (now taking just 1 minute).

CommentFileSizeAuthor
#1 entity-speedup-revert.patch492 bytesaleksander belov

Comments

aleksander belov’s picture

Status: Active » Needs review
StatusFileSize
new492 bytes
alesr’s picture

Assigned: aleksander belov » Unassigned
Status: Needs review » Reviewed & tested by the community

Code speaks for itself and this has to be commited:

-      foreach ($defaults as $name => $entity) {
-        entity_delete($this->type, $name);
-      }
+      entity_delete_multiple($this->type, array_keys($defaults));

A big optimization that turned Feature reverts from minutes to seconds!

Thanks Aleksander.

RTBC from me.

joelpittet’s picture

Nice! RTBC++

fago’s picture

Title: Entity definition takes forever to revert » Speed up feature revertion of entity exportables

Good finding!

  • fago committed 804d38b on 7.x-1.x authored by Aleksander Belov
    Issue #2448151 by Aleksander Belov, alesr, joelpittet: Speed up feature...
fago’s picture

Status: Reviewed & tested by the community » Fixed

Committed!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.